Live data from Hacker News

How To Optimize Your Site With HTTP Caching

betterexplained.com

11–20 of 30 posts

Re: How To Optimize Your Site With HTTP Caching

#11
post #4
post #2

Article from 2007

2008+ version -- throw your assets into CloudFront (or another CDN of choice), let CDN handle the caching. ;)

I know you say that in jest, but I would say that it is still good to know the underlying technology. It is much easier to debug issues in the future once you understand them.

Re: How To Optimize Your Site With HTTP Caching

#12
post #7
post #2

Article from 2007

Yep, I was surprised too to see it on HN :). 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…

The best way I've seen for dealing with cache expiry, which the article does not talk about, is to use version numbers on assets. We found this to be especially important with javascript, css, etc -- if all of that stuff doesn't expire at the same time, it can hose the layout of your site.

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.

Re: How To Optimize Your Site With HTTP Caching

#13
post #6
post #3

This is a great article for an introduction to HTTP caching. It's well-written and even covers how to set up caching in Apache.

Thanks for the kind words (I'm the author). My main, ever-evolving goal when writing tutorials is to try to write what I'd like to see: 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 really enjoyed your writing style. It didn't push its (successful!) attempts at humor and used them sparingly enough to be a joy when they were read.

Re: How To Optimize Your Site With HTTP Caching

#14
post #13
post #6

Earlier quoted context omitted.

Thanks for the kind words (I'm the author). My main, ever-evolving goal when writing tutorials is to try to write what I'd like to see: 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 really enjoyed your writing style. It didn't push its (successful!) attempts at humor and used them sparingly enough to be a joy when they were read.

Thanks! It's easy to get self-conscious about putting humor into a tech article :)

Re: How To Optimize Your Site With HTTP Caching

#16
post #6
post #3

This is a great article for an introduction to HTTP caching. It's well-written and even covers how to set up caching in Apache.

Thanks for the kind words (I'm the author). My main, ever-evolving goal when writing tutorials is to try to write what I'd like to see: 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've always enjoyed your writings kalid. I esp liked http://betterexplained.com/articles/a-visual-intuitive-guide.... Thanks so much for your site!

Re: How To Optimize Your Site With HTTP Caching

#18
This is a good writeup, though I'm surprised no-one has mentioned the holy grail of caching with HTTP. That of course is good old RFC 2616: http://www.ietf.org/rfc/rfc2616.txt

There's an entire section in there devoted just to caching in HTTP. Very well worth reading in its entirety.

Re: How To Optimize Your Site With HTTP Caching

#19
post #4

Earlier quoted context omitted.

2008+ version -- throw your assets into CloudFront (or another CDN of choice), let CDN handle the caching. ;)

I know you say that in jest, but I would say that it is still good to know the underlying technology. It is much easier to debug issues in the future once you understand them.

Concur - I think that, once you have a certain amount of experience built up working in frameworks like Rails, you can only go so far before you hit a wall. At that point, it's necessary to start learning the protocols and the lower level stuff to advance your understanding and your craft.
Post reply on HN