wp-cache – a reminder to myself
June 20th, 2007
wp-cache is a useful plugin for speeding up your WordPress blog. However, it has some disadvantages:
- If you're in the middle of a redesign, where you're changing the presentation features of the site without changing the content, you have to clear the cache to see the effects of changes.
To clear the cache, go to the wp-content/cache directory and do:
rm -rf * - If, like me, you have some fairly static pages that contain dynamic content in a sidebar (e.g. an About page that has a list of recent posts in the sidebar), the sidebar content will not change because wp-cache makes sure the page from the cache gets served up unless something actually changes in the content.
Effectively this means doing a manual cache clear every time you post if you want your static pages to be regenerated.
Turning off wp-cache
WordPress leads you to believe you can turn off wp-cache by deactivating it in the Plugin Management page of the admin interface. Unfortunately it's not as easy as that.
What you need to do is go into your wp-config.php file and delete or comment out (by adding // at the start of the line) the following line:
define('WP_CACHE', true)
If you want to completely remove wp-cache, rather than just temporarily disabling it while you do some redesign work:
- Delete the wp-cache directory within the wp-content/plugins directory.
- Delete the line from the wp-config.php file, as above.
- Delete the wp-cache-config.php and advanced-cache.php files from the wp-content directory.
Where wp-cache comes into its own is if you have a standard blog that gets a lot of hits. wp-cache stores ready-made HTML pages that can be served straight up to your visitors without having to use PHP to generate SQL queries to the MySQL database and build HTML dynamically.
Potentially similar posts
- How quickly do your pages load around the world – April 2009
- Getting tag changes to show up in Windows Media Player – December 2008
- Deleting a symbolic link via FTP – October 2008
- WordPress upgrade plugin – October 2008
- Migrating a hosted WordPress site to your local PC – October 2008