If you’re running your blog from a hosted platform, such as wordpress.com, Typepad or Blogger, you probably don’t have to worry about database (and/or PHP) servers choking and bandwidth running out. For folks who run blogs on their own hosting accounts or servers, this is a possibility. Yet then again, for the average blogger bandwidth and server resources shouldn’t be an issue. Even the most inexpensive hosting account on most providers these days can give enough for most folks (some hosting providers I can point to are our very own Colorteck and one of our sponsors, Cirtex).
This only becomes a big concern when you become really popular or when you get rare DIGG or Slashdot-effect traffic spikes. Or perhaps your server is a bit low on resources, and is serving up your site slowly. To address these, you can use caching plugins. We have been using several caching plugins on some of our bigger blogs like the Blog Herald and Forever Geek. Not only are traffic levels there consistently high, sometimes we also get frontpaged on DIGG, Slashdot, Stumbleupon and other social bookmarkers.
WP-Cache is one good plugin. Another one is WP-Super Cache, which is actually built upon WP-Cache.
We’ve recently switched to the latter, and so far we’re satisfied.
Basically, caching works by generating static files on your server, such that database requests are no longer required. This lightens the load on your database server, and makes loading faster, too.
According to the WP-Cache profile:
It works by caching Worpress pages and storing them in a static file for serving future requests directly from the file rather than loading and compiling the whole PHP code and then building the page from the database. WP-Cache allows to serve hundred of times more pages per second, and to reduce the response time from several tenths of seconds to less than a millisecond.
And WP-Super Cache improves on this:
[WP-Cache 2 still uses] the PHP engine to serve the cached files.
WP Super Cache gets around that. When it is installed, html files are generated and they are served without ever invoking a single line of PHP. How fast can your site serve graphic files? That’s (almost) as fast it will be able to serve these cached files. If your site is struggling to cope with the daily number of visitors, or if your site appears on Digg.com, Slashdot or any other popular site then this plugin is for you.
Great! So caching plugins help make my site load faster AND it takes the heavy load off the server by minimizing PHP execution and database queries. However, one big disadvantage of caching is that essentially your site will be static, and any dynamic elements might not work.
Sure, everytime you publish a new post, the cache is refreshed. And everytime someone posts a comment, the cache for that particular post is refreshed. At least it’s supposed to be that way. But how about those instances when you need rotating content or images. For instance, some themes use rotating headers. And sometimes, like with several blogs in the Splashpress Network, we use rotating ads (links or images that share the same spot, supposedly alternating). Another issue is when you pull feeds from external sites, like we do. See those three boxes at the rightmost sidebar? Those are feeds pulled from some of our blogging resources.
I’m not sure if caching plugins support this, but I’m assuming they don’t, since the premise with caching is that static files are served until (1) they expire; (2) they are refreshed with new posts or comments or (3) they are manually reset.
For most folks, this is not an issue. And perhaps we can resort to measures that can help resolve these. But what I’m looking for is a plugin wherein you can define which areas of your blog to cache and which not to. Hopefully that won’t be too complicated.
Do you like this article? Submit it to Blogosphere News!
13 Responses
Donncha O Caoimh
May 7th, 2008 at 8:14 am
1Just use Javascript for the dynamic parts of your page. That’s the easiest (and oldest) way of including dynamic content in a page.
redwall_hp
May 7th, 2008 at 9:45 am
2I get a descent amount of traffic, a lot of which is from StumbleUpon, and I’m running on a shared host. I use WP Super Cache to maximize my mileage transfer-wise.
My advice, for cache uses who need to have some dynamic content, like a banner rotator, hack your banner script to output JavaScript so you can still use it through the cache. It’s a bit of a pain to setup, and takes some l337 PHP skills, but it works fairly well.
DMZ
May 8th, 2008 at 9:03 am
3–
I’m not sure if caching plugins support this, but I’m assuming they don’t, since the premise with caching is that static files are served until (1) they expire; (2) they are refreshed with new posts or comments or (3) they are manually reset.
–
This is going to sound a little negative, but –
Really? You wrote that whole post but couldn’t be bothered to take the extra minute or two to read the documentation on this and come up with an answer better than “I assume they don’t?”
Come on.
I have to admit I unsubscribed from the RSS feed after reading this one.
web tasarım
May 8th, 2008 at 8:06 pm
4Thanks for the article..
ameo
May 9th, 2008 at 2:12 am
5i thought about it actually sometimes but never went for it .
i’ll try it now and see what happens . thanks
J. Angelo Racoma
May 9th, 2008 at 7:56 am
6DMZ, I don’t know if I intended it that way or not, but I did refer to any caching plugin in particular. I just stated that I wasn’t sure if caching plugins _in general_ did this.
And if you need a specific answer, no - WP Super Cache doesn’t support this, unless you use JavaScript to load those dynamic aspects of your site. I read the documentation.
Cheers,
angelo
Ajay
May 18th, 2008 at 12:30 am
7One problem (or feature??) is the amount of space my cache took. I had to increase the disk storage of my account to accommodate for the cache.
I guess it is great at times when the traffic hits a major high, however for regular traffic it isn’t going to give you too much of a saving.
youtube
May 26th, 2008 at 1:47 pm
8Great! So caching plugins help make my site load faster AND it takes the heavy load off the server by minimizing PHP execution and database queries. However, one big disadvantage of caching is that essentially your site will be static, and any dynamic elements might not work.
turkrap
July 2nd, 2008 at 3:02 pm
9This is going to sound a little negative
Alan
August 13th, 2008 at 3:33 pm
10What is the best thing to do for this PHP code
cache = [true or false] - Cache the rss feed for faster load
rap
September 21st, 2008 at 4:40 pm
11Great! So caching plugins help make my site load faster AND it takes the heavy load off the server by minimizing PHP execution and database queries. However, one big disadvantage of caching is that essentially your site will be static, and any dynamic elements might not work.
programlar
September 22nd, 2008 at 11:06 am
12Great! So caching plugins help make my site load faster AND it takes the heavy load off the server by minimizing PHP execution and database queries. However, one big disadvantage of caching is that essentially your site will be static, and any dynamic elements might not work.
program
September 22nd, 2008 at 11:06 am
13However, one big disadvantage of caching is that essentially your site will be static, and any dynamic elements might not work.
RSS feed for comments on this post
Leave a reply