To Cache or Not to Cache?
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.
How caching plugins work
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.
Pros and Cons
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.






Just use Javascript for the dynamic parts of your page. That’s the easiest (and oldest) way of including dynamic content in a page.
I 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.
–
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.
Thanks for the article..
i thought about it actually sometimes but never went for it .
i’ll try it now and see what happens . thanks
DMZ, 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
One 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.
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.
This is going to sound a little negative
What is the best thing to do for this PHP code
cache = [true or false] – Cache the rss feed for faster load
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.
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.
However, one big disadvantage of caching is that essentially your site will be static, and any dynamic elements might not work.
i’ll try it now and see what happens . thanks.
ok mn thnku;)
its great article thank you
if folks want to ‘test it out’ please feel free to hit my site, though only if you’re gonna leave real comments! don’t try ‘manual spam’ to disprove it (what i mean is that you can see a real comment float through just fine, contrary to what others above are saying)
if folks want to ‘test it out’ please feel free to hit my site, though only if you’re gonna leave real comments! don’t try ‘manual spam’ to disprove it (what i mean is that saying)
ase feel free to hit my site, though only if you’re gonna leave real comments! don’t try ‘manual spam’ to disprove it (what i mean is that you can see a real comment float through just fine, contrary to what others above are saying)
y ‘manual spam’ to disprove it (what i mean is that you can see a real comment float through just fine, contrary to what others above are saying)
if folks want to ‘test it out’ you’re gonna leave real comments! don’t try ‘manual spam’ to disprove it contrary to what others above are saying)
mments! don’t try ‘manual spam’ to disprove it (what i mean is that you can see a reing)
real comment float through just fine, contrary to what others above are
very thanks
real comment float through just fine
Global chat sites
Thank you.
globah hot
thanks
kredi
thanks for everything yo do.
thanks admin..
thanks admin
usullay
thanks for everything yo do.
Muy buen blog. No veo la hora de que llegue el mundial de futbol en sudafrica 2010
thanks for article.it’s great article for me.
thanss vey good.
Thanks admin. Very nice and cool. Super…
Thanks admin. Very nice and cool.
Super…
Thanks admin. Very nice and cool. Super site…
Thanks admin. Very nice and cool. Super…Good job.
Thanks admin. Very nice and cool. Good job…
Thanks admin. Very nice…Good job…
tekekürler.. güzel çalışma
veri kurtarma, data veri kurtarma, veri kurtarma indir, kurtarma
programı, veri kurtarma programı, disk kurtarma, disk veri kurtarma, veri kurtarma full, data
recovery, veri kurtarma format, silinen veri kurtarma, hdd veri kurtarma, silinen dosyaları
kurtarma, data kurtarma, veri nedir
Fore Kazık, Kazık Makinası, BEKSAL ZEMİN, Sağlıklı yapılar için Fore Kazıklama sitemleri şarttır.
Thanks for posting about this, I would like to read more about this topic.
thabks nice share
1 Number of chat sites expect you all http://www.seslichatodasi.com Thanks
thabks nice share
Thank you this is really nice share
Basically, caching works by generating static files on your server,
thank you admin nice post
Thank you for this information is very useful to me
thanks
very nice
thanks
very nice
liseli liseli kizlar
So adsense will not work if catching is enabled?
Thansk for post… Very nice.
thanks
very nice
Looks great, I’ll try it on my site. Thanks
thanks for article,great job, thanks from turkey
very good post thanks
thanks very nice
Thansk for post… Very nice.
Very nice thank you post
thanks admin good site
To Cache or Not to Cache? | BloggingPro I was recommended this blog by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my difficulty. You are wonderful! Thanks! your article about To Cache or Not to Cache? | BloggingPro Best Regards Lisa Justin
thnks for u
thanks for the art?chal
thanks for article.it’s great article for me..
Thanks for the hints.