How To Optimize Your Site With HTTP Caching

I’ve been on a web tweaking kick lately: how to speed up your javascript, gzip files with your server, and now how to set up caching. But the reason is simple: site performance is a feature.


This is a companion discussion topic for the original entry at http://betterexplained.com/articles/how-to-optimize-your-site-with-http-caching/

There is no such thing as an “If-None-Exist” header in HTTP; I think you mean “If-None-Match.”

Whoops, my mistake. It should be fixed now.

[…] How To Optimize Your Site With HTTP Caching | BetterExplained Very nice guide to controlling cache headers with apache (tags: cache http optimization performance tips web) […]

http://httpd.apache.org/docs/2.0/mod/mod_expires.html

[…] How To Optimize Your Site With HTTP Caching Caching doesn’t help with the initial download (that’s what gzip is for), but it makes the overall site experience much better. (tags: Cache) […]

[…] Using HTTP caching to improve performance This Article from the BetterExplained blog is a pretty nice explanation of how to configure your server for better performance by using cache headers. Which complements nicely the article on Varnish I was just reading. Caching is a great example of the ubiquitous time-space tradeoff in programming. You can save time by using space to store results. […]

[…] Unique filename for uploaded files (such as Windows Defender on Microsoft Download Center). If each version of the file gets its own GUID, you can set a long cache expiration time. […]

This is an awesome, awesome guide. Thanks!

Thanks Julius, I’m happy you like it :slight_smile:

[…] How To Optimize Your Site With HTTP Caching […]

[…] Explain of cache control in detail (very nice article! ) http://betterexplained.com/articles/how-to-optimize-your-site-with-http-caching/ […]

I just recently implemented caching on my blog. It makes a lot of difference!

BTW, What do you use for your diagrams?

Hi Carlo, I’m glad it worked for you! I use PowerPoint 2007 to make the diagrams.

[…] HTTP Caching lets you avoid downloading a file you already have […]

[…] As you visit a page, you’ll see HTTP headers fly by as your browser requests elements. If items are cached, the browser may not request them at all (awesome!) or may request the element and get a 304 “Not Modified” response (slightly less awesome, you still had to check with the server). I’ve written more on cache behavior, and Live HTTP Headers is a great way to learn about HTTP caches (something every webdev should be interested in for performance reasons). […]

[…] As you visit a page, you’ll see HTTP headers fly by as your browser requests elements. If items are cached, the browser may not request them at all (awesome!) or may request the element and get a 304 “Not Modified” response (slightly less awesome, you still had to check with the server). I’ve written more on cache behavior, and Live HTTP Headers is a great way to learn about HTTP caches (something every webdev should be interested in for performance reasons). […]

[…] Another approach is to explicitly set the browser’s cache expiration. In order to do this, you’ll need access to PHP or Apache’s .htaccess so you can send back certain cache headers (read more on caching). […]

[…] Unique filename for uploaded files (such as Windows Defender on Microsoft Download Center). If each version of the file gets its own GUID, you can set a long cache expiration time. […]

This is a great article, well written.