Support » Plugin: WP Super Cache » [Plugin: WP Super Cache] Cache clearing and shouldn't?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Do you happen to have ‘Clear all cache files when a post or page is published or updated.’ checked in advanced settings?

    I do not have that checked

    What’s it say under the Contents tab under garbage collection? Should look something like

    Garbage Collection
    Last GC was 55:17 minutes ago
    Next GC in 14:43 minutes

    It used to say that, but since i have set the expiration to 0 that message has dissapeared.
    I am running debug to catch when the cache does clear again

    Hm. I just found this in the preload scheduler function

    if ( $wp_cache_preload_interval > 0 ) {
    	$cache_max_time = (int)$wp_cache_preload_interval * 60; // fool the GC into expiring really old files
    } else {
    	$cache_max_time = 86400; // fool the GC into expiring really old files

    Looks to me like this overrides the cache timeout setting and then it runs the thing to get rid of expired files. It does this LAST in the function, so if you happen to check the cache after a big cleanout but before the next preload, I see why it would be empty. I could be reading the code wrong, but it seems like an order of operations issue.

    Interesting, I do have preload activated but the interval set to 0.

    so would that else statement kick off the GC every 86400 despite having GC disabled?

    I think you said you had Cache Timeout set to 0 (disable GC) but Preload Mode on, so you must have some value higher than 0 for Preload Interval, no?

    If so, then yes, the preload function kicks off every {preload interval} seconds. IF I’m reading the code right, the last thing it does is set a fake cache_max_time (Cache Timeout) of 86400 and then runs GC anyway 🙂

    I’m not going to try to fix this one because for all I know, maybe you HAVE TO kill old files if preload is ever going to run and it could take tons of refactoring to get it to work as expected.

    side note: i’m off for the day. Talk tomorrow. Good bug reports!

    I actually DO have the interval set to 0. I put it into preload to see if that would stop the cache from getting dumped via GC, but set the interval to 0 to disable the auto preload. This way i can hit ‘preload now’ if i want to and otherwise just leave it alone.

    One reason I’ve done this is the preload is not working correctly either which i have another post that never got any attention…

    OK, I’m getting the full picture now. So cache timeout is 0. Preload interval is 0. Everything is quiet. You hit Preload cache now. Thing builds your cache, then sets a cache timeout of 86400 and cleans out old files. But no files should be old bc they are refreshed in batches by wp cron. Even if the 86400 rule nukes everything, preload does like 100 posts at 30 second intervals, so it should rebuild right after.

    Damn. I am stumped. :/ Best thing I can tell you is to keep debugging enabled and monitor for ‘Cleaning expired cache files’ and ‘wp_cron_preload_cache’. Also, switch on emails for preload. That should give you a beat on the issue if it starts running without your involvement. Sorry I couldn’t be more helpful.

    Plugin Author Donncha O Caoimh


    Kevin – can you enable the debugger in the plugin and watch it when your site preloads? Even though you have garbage collection disabled the preload function has to clear out really old cache files. In this case it’s cache files older than a day.

    It shouldn’t clear out newly preloaded pages though.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: WP Super Cache] Cache clearing and shouldn't?’ is closed to new replies.