85 points · by zerop · 14y ago · 29 comments
There's an entire section in there devoted just to caching in HTTP. Very well worth reading in its entirety.
Direct link to Caching in HTTP http://tools.ietf.org/html/rfc2616#section-13
1) Explain the underlying concept
2) Show variations
3) Explain how to do it yourself
4) Show how to verify you did it correctly
5) Meta: be as concise as possible, maximize bang for the buck
I think one of the meta-takeaway is that understanding the fundamentals of web caching can help with your general CS knowledge ("There are only two hard problems in Computer Science: cache invalidation and naming things." -- Phil Karlton).
Looking at Apache, we see a few strategies:
* Include last-modified metadata
* Include content metadata (eTag/md5 of content)
* Include explicit expiration date
* Include a max-age
* Include metadata about who can cache (public/private/no-caching, i.e. users can cache but proxies cannot)
These approaches could be used when designing data flows with Memcache, Redis, etc.Also there are may be many layers of caching between you and the user; not only HTTP caching in the browser, but you have to take into consideration any CDN's (Akamai, etc) and sometimes even caching reverse proxies in corporations.
At my previous job, we handled the versioning with deployment-time rewriting of the assets included in the base page to include the version number (As tagged by the build software with branch name + build number).
That said, enabling browser side caching was a huge win for page speed on the site.
I'd take it to Google, but I have no idea how I'd ask that in Google query form.