ArticlesForumDownload AboutContact

boakes.org

nice of you to drop by. tea?

tags: WordPress

Wordpress with Page Cacheing

June 7th, 2005, by Rich.

A small improvement to this site - page cacheing using WP-Cache-2.

I’ve seen a 240% increase in traffic this month (on top of 20% last month and 240% the month before that, and whilst bandwidth is not an issue, the poor web server needs a helping hand to ensure everything runs nicely. Additionally, I’m one of the maintainers of the other sites hosted by the machine so it’s a bit of pro-active management.

Adding a cache to wordpress reduces load in several ways -

  1. less php code has to run in order to generate the page, this reduces load on the server.
  2. fewer SQL queries are run in order to retrieve the content from the DB, so that server is happier.
  3. there’s less network traffic between the web server and the DB server - ok this is fairly negligible anyway, but it all helps.

When content or comments are added the relevant cached pages are flushed so that the next reader gets the freshest page and thereafter that page remains cached until it needs updating again.

The upshot is that page access is significantly faster; in some (worst) cases it’s down from a five second generation time to sub 0.1 seconds.

2 Responses to “Wordpress with Page Cacheing”

  1. 1
    Rob Says:

    I’ve been looking for a description of how the flushing works and what exactly will be flushed, and this is the closest thing I’ve found. The strange thing is that the plugin homeage has no mention of this. Are there any issues with old content being held on to?

  2. 2
    rich boakes Says:

    I’ve seen no problems with old data yet. Whenever I write or update an article or a comment, the cache is suitably purged. Specifically, having just checked, I can confirm that when I submitted this comment the entire cache was purged, and the same thing happened when I added this extra sentence - adds and updates purge everything.

    Basically it appears that any purging is total, so it’s not (yet?) possible to, manually point-click-remove individual pages from the cache.

    It’s also worth noting that it correctly caches different versions of the same page, which is useful because for my logged in access I use a different theme that has added admin functions.

    There is also a small issue with plugins like StatTraq that are unrelated to the displayed content. Where the cache streamlines things by not calling most of the code, these plugins don’t get called either. I had to manually alter the index.php to inform StatTraq whenever a page is requested.

Have your say...