Google PlusFacebookTwitter

Cached Out!

By on May 17, 2008 in Personal, Tech Takes | 0 comments

Share On GoogleShare On FacebookShare On Twitter

Firstly, I would like to apologize to all readers for the problems my blog has been having since yesterday. I had tried to make the user experience better by allowing caching of files so that they could be served quickly. This caching script ran into trouble soon after, resulting in the end reader having to endure everything from ‘Failed to connect to database’, to 500 errors to 404 errors. Everything has now been sorted out, and caching has been disabled. Everything should be working just fine now. A big thanks to Naman for providing his copies of crucial WordPress files so that I could compare with mine and sort out the mess. Also learnt another important lesson, that of having backups which DO NOT overwrite older entries.

I’ve been getting quite a lot of traffic recently on my blog recently that I had to take the drastic step of resorting to aggressive caching. You see, WordPress generally simply keeps all the posts, comments. etc in a database, and then when a viewer tries to access a page, it pulls the data from the database and creates the page on-the-fly using PHP. Now if your blog starts getting a lot of traffic, what happens is that it takes quite some time for the server to call the database, execute scripts and then serve the page each time. ‘Caching’ basically means a ‘static’ version of the page made using HTML is created so that it takes less time to serve the page to you, the reader.

So then, caching has been enabled on my blog. The reason is that for the past few days my blog had been pretty slow to load. Maybe it was the traffic, or maybe it was simply a problem with my provider GoDaddy. GoDaddy keeps your hosting stuff and your database located on different machines. That’s partly as a security measure, but mostly to save bundles of money. So far, my experience with GoDaddy has been quite good. It remains to be seen however if that sours later on.

Meanwhile, here’s what will happen. Pages on my blog will be cached from now on. For people who aren’t logged in (the authors on this blog) and for people who haven’t left any comments (quite a lot of the people, the pages will update every six hours. In between that time, you guys will be served a cached version of the page. That shouldn’t be a problem since the post content itself doesn’t change much. However, you might not get to see the latest comments. The RSS feeds won’t be affected by the caching, so all updates will be real-time updates. And yes, the caching doesn’t affect the front page, so when you visit my blog, the front page WILL list the latest posts.

Do tell me if anyone of you encounters any issues because of this (comment form not working, other features dead, etc). Get in touch with me through my contact page.

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.