Hacker News new | past | comments | ask | show | jobs | submit login
Testing HTTP caching in Go (sanarias.com)
65 points by santiaago on Feb 16, 2015 | hide | past | favorite | 6 comments



The article is very good, I read it all the way to the end and learned quite a few things. But the title is just a bit misleading, it is more like "test coverage in go, with an example using http cache". Thanks for writing and sharing.


That is very true, but at least the article has links to the previous tutorials that fill out the background of the topic.


Serious question: is properly handling the "Not Modified " status code really considered caching or is there a better name? Maybe client-side caching? HTTP caching in my mind is associated with something like varnish.


Yes, that along with dealing with Last-Modified, If-Not-Modified, ETag, and other similar HTTP Headers is what is meant by HTTP Caching.

From what I can tell Varnish uses these same concepts to do what they do (caching HTTP reverse proxy).

See

* https://tools.ietf.org/html/rfc7234#section-1

* http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html

* https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching_FA...


Conditional GET and not re-downloading the same content are important aspects of caching. They save bandwidth and remove the download part of latency. For small resources, serving the content again instead of 304 will not matter.


Caching is simply keeping a response that hasn't changed so you don't have to recompute it. There can be many levels of cache. Varnish is one useful type of cache, but there are many others too.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: