Welcome to “The Caching Chronicles”
By sru on Mar 31, 2009 in Caching in General
This is yet another site born in my search for a place where I can drop my thoughts, ideas and other stuff. This time it’s all about caching. In particular this means caching of content normally delivered by a web server to a requesting party. Now, why caching? Isn’t that a technology we should have thrown out of the windows by now? Servers are so much more powerful than they were in the beginning of the web era. Internet connection even for home users is ten to hundred times faster than when it all started. Do we really still need caching?
Yes, we do.
There are many reasons for that – and I’m going to dive into all of them by time – but the most important one also is the most convincing: it’s about money.
Money you spend on hardware, hardware you need to pump out your content to users with ever fatter pipes. Users who demand that your site loads in a fraction of a second otherwise they’ll be gone for good. And as much as you may tweak your Apache server, optimize the PHP code and apply every trick from the book of web system tuning: it won’t really cut it. The major reason for that is that even for the delivery of a simple static HTML page with no fancy images or complex JavaScript, you’ll have to fire up your full blown Apche or whatever other server you’re using. It’s this overhead that eats up precious CPU cycles and brings down your site’s perceived performance.
And that’s where caching comes into play.
Because there is no need to fire up a full blown web server for trivial stuff like sending out pictures, JavaScript and CSS. This can easily be handled by a cache fronting the actual web server. As of now, there’s one major player you’ve surely heard of: Squid. But there is a new guy in town, too: Varnish. Since I’m using both of them in production environments there’s a lot I have to say about them.
And no, I won’t talk about the cache system built into Apache. Because in my eyes, this is the worst cache you can use. It adds yet another overhead to the probably already bloated web server, namely managing the files in the cache. And bloating the web server even more is exactly what you really, really, really don’t want to do. But enough for today, I’ve got some other pressing things that need attending.
