Skip to content

Plugin invalidates entire cache with (W3 Total Cache) #18585

@E1NSER

Description

@E1NSER
  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

As soon as a post is saved or updated, the complete cache is invalidated in connection with the plugin "W3 Total Cache".

/**
* Clears the WP or W3TC cache depending on which is used.
*
* @since 1.8.0
*/
public static function clear_cache() {
if ( function_exists( 'w3tc_pgcache_flush' ) ) {
w3tc_pgcache_flush();
}
elseif ( function_exists( 'wp_cache_clear_cache' ) ) {
wp_cache_clear_cache();
}
}

Please describe what you expected to happen and why.

Only the cache of the post that is currently being edited should be invalidated.

How can we reproduce this behavior?

  1. Install "W3 Total Cache" and "Yoast"
  2. Activate the "Page Cache"
  3. Create 2 or more posts
  4. Load the posts in the cache of "W3 Total Cache"
  5. Update one of the posts including data from the "Yoast Metabox"
  6. Save your changes
  7. Now you will see that every of the posts created earlier are invalidated and no longer cached

Used versions

  • WooCommerce version: 6.5.1
  • Yoast SEO version: 19.1
  • Yoast SEO Premium version: 18.7
  • W3 Total Cache version: 2.2.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions