HOWTO: Fixing the wp-cache “0 files” bug

April 19th, 2009 in Micro Blog

I moved my websites to a virtual private server at Dreamhost last week and found that the wp-cache plugin stopped caching files. It’s a simple problem and a simple fix, but it took me a few minutes to realize what was happening.

The symptoms

  • Site pages take longer than half a second to load
  • The wp-cache stamp can’t be found on some or all of your site pages (found after the footer when viewing the page source)
  • After deleting the cache using wp-cache cache manager, no new pages are added to the cache

The fix

The bug is caused by restoring an old version of your site files, or by moving your site to another server (or otherwise changing your server setup). The symlink wp-content/advanced-cache.php gets out of sync with your WordPress installation, and now refers to an invalid location.

  1. ssh to your server, and cd into the wp-content folder
  2. Delete the symlink (rm advanced-cache.php)
  3. Go to the wp-cache manager page in your WordPress admin panel
  4. Disable/enable the cache, and load some pages on your site
  5. wp-cache will now relink the configuration and caching will resume
  6. Test by looking for the wp-cache comments in the footer of your returned page source