HTTP caching

Optimizing the cacheability of your web app is one of the best ways to improve its performance.

About HTTP caching

The best introduction to HTTP caching is Mark Nottingham’s caching tutorial.

Some approaches to caching

For a directory of static files, especially images, using Apache’s mod_expires is probably the best choice.

For a dynamic web app, you’ll need to keep track of changes and emit the HTTP headers yourself. A quick and dirty method for PHP is described in Simon Willison’s article supporting conditional GET in PHP.

Testing your site

You can examine your browser’s requests and the site’s responses using browser-based tools such as Firebug for Firefox or Safari’s Web Inspector.

The Cacheability Engine acts as a sort of validator, building a report of the cacheability of each resource on your page.

[ article last updated 2009-05-24 08:28:50 by cobra libre ]