Caching


Front End Caching

So you think you want to cache do ya? Of course you do! Caching is a very broad topic, and if you want to get serious about it there are plenty of books and, god forbid, you can read the spec on it. I'll try to cover the useful basics here. The thing to remember about caching is WHY you are caching - you are trying to avoid any unnecessary requests from hitting the server, and if they do hit the server, keeping the response as small as possible. Your server doesn't want to server user.gif for every page, and your browser doesn't want to render it. Luckily, any caching you do benefits both of these players.

 

Please note that I'm purposely omitting a CacheFu or Httpd acl HOWTO - if you understand the basics then using these tools will be easy. Everyone has their own preferences as to which they prefer, and most systems.

 

Debugging

Tools

 

"Levels" of Caching

Here are things to know, ordered from the most ideal situations to the least.

 

Gotchas

 

Back End Caching 

So you're browser caved in and has requested a page. Chances are everyone else's browser did too. How can repeated page renderings be cached? What about expensive database operations or calculations? Fear not young scallywag for there is help!