[Plugin: WP Super Cache] Clear one cache file when a post or page is updated (4 posts)

  1. sant0sk1
    Posted 7 years ago #


    I notice there is an option with wp-super-cache to:

    Clear all cache files when a post or page is published

    What would be infinitely more useful would be an option to:

    Clear appropriate cached file when a post or page is updated

    There's no need to purge the entire cache just because one page has been updated, but it would be very useful for that page's cache file to be purged. Couldn't you hook into edit_post or edit_page hooks and remove the cache for that item using the permalink or something?

    That would be ridiculously rad. Love the plugin, thanks for your hard work!

  2. The problem with that is how would you get the archives/index/etc pages updated with the new post/page?

  3. sant0sk1
    Posted 7 years ago #

    Well, you just have a modifiable set of pages that would be affected by a post/page change:


    The list is finite and pretty static

  4. Donncha O Caoimh
    Posted 7 years ago #

    sant0sk1 - it already does some of what you describe. Take a look at wp_cache_post_change(). Send me a patch if you come up with more complete code.

Topic Closed

This topic has been closed to new replies.

About this Topic