Cache Cleaner For WP Super Cache
WP Super Cache is an excellent caching plugin, but sometimes it seems to have problems with deleting expired files. For example, even though this site typically gets at least 3000 pageviews per day, and I’ve set WP Super Cache to delete expired files every 1000 requests (the lowest setting), the expired files tend to accumulate. Also, for lower-traffic sites it could take more than a day to get at least 1000 pageviews, and the cache might get stale.
Enter the “WP Super Cache Cleaner” - a simple WordPress plugin that will periodically delete expired super-cache files regardless of whether your blog has reached the “X requests” threshold. You can set it to run either daily or hourly (the default is daily). The plugin will then use the built-in WordPress scheduler to automatically clean the cache that often.
Note that in the current implementation only expired “super-cached” files will be deleted - WP-Cache files won’t be affected.
Download
cache-cleaner.zip (2 KB)
Compatibility : Tested with WordPress 2.6.2 - 2.7 and WP Super Cache 0.8.1 - 0.8.3.
Installation : Upload, activate, go to Settings -> Cache Cleaner to configure.
Extra Tip
For increased reliability, set up a cronjob to run wp-cron.php at the same frequency as you used for this plugin. For example, if your blog is found at “http://example.com/” and your control panel is cPanel, you can set up a cronjob like this :
- Log into cPanel and click on “Cron jobs”. Select the “Standard” interface.
- Select “Every Month”, “Every Week Day” and “Every Day” from the appropriate lists.
- If you set the plugin to run every hour, select “Every Hour” from the “Hour(s)” box. Otherwise, select any other setting from that list.
- Select any number from the “Minute(s)” list.
- Enter this command as “Command to run” :
wget -q -O /dev/null http://example.com/wp-cron.php
- Save Crontab.
Note that setting a specific time for the cronjob - e.g. “09:24″ - will not make the plugin delete expired files at exactly that time, except perhaps by a lucky coincidence. This is not a bug.
Related posts :







Interesting plugin, but I’ve just tagged a new release of WP Super Cache that does something similar. I’ve had it running on my own blog for the last two weeks and it works fairly well. It deletes expired files at predetermined intervals, the default being an hour.
Hope that works better than the “every X hits” method.
Gah, I guess I need to start coding only things that are completely unique, instead of improvements/hacks for existing systems. They just don’t have staying value.
Edit: The problem is unique ideas are hard to come by or bloody hard to implement.
You’re on the right track though, “Scratch an itch”. Whatever you find useful, others will too.
Anyway, watch my blog, I’ll be posting about the new release shortly
[...] revealed some change was recently made to garbage collection timing. Someone suggested I try the WP Super Cache Cleaner WordPress plugin that will periodically delete expired super-cache files regardless of whether your [...]
[...] ø Cache Cleaner For WP Super Cache | W-Shadow.com ø (tags: plugin cache wordpress wp_plugins wp wordpress-glugin) [...]