Support » Fixing WordPress » [Plugin: WP Super Cache] Clearing Cache for Pages on Commenting

  • We are using Super Cache in our testing and it works fine except there is one thing we don’t want to happen. When a new comment is submitted, the cache is cleared for that page, which makes sense because that way it appears right away to the user.

    But it also clears the cache for all our category pages, and that is slowing us down considerably as our top-level nav is composed of pages, so when users hit those pages after a comment they are not cached.

    Is there a way to turn off this caching of category pages when a comment is submitted? Why does it do this? I know it’s what WP-Cache does but what’s the purpose?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • It’s because the same functions are used to clear the cache for individual posts when comments are made and when posts are made. It probably would be useful if they were separated out somehow. I’ll look into it.

    You could use the cache rebuild feature of the plugin, so the pages are only rebuilt once and slightly stale cache files are served to all but the first visitor of each page.

    Thanks! We’ll look into this solution and if you find anything with separating them out please let me know!

    Do you think there are any quick fixes for that by modifying this function?

    function wp_cache_post_change()

    Yeah, you could probably add an is_admin() check around the code that deletes the category and tags pages. At least that will stop the caching being deleted when people leave unmoderated comments.

    Moderated comments would still clear those cached pages when you approve them however.

    Try the development version, I added an option, “Only refresh current page when comments made.” that should satisfy what you want to do.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WP Super Cache] Clearing Cache for Pages on Commenting’ is closed to new replies.