Once upon a midnight dreary, while I websurfed, weak and weary, Over many a strange and spurious website of 'hot chicks galore', While I clicked my fav'rite bookmark, suddenly there came a warning, And my heart was filled with mourning, mourning for my dear amour. "'Tis not possible," I muttered, "Give me back my cheap hardcore!"
HTTP Caching is bretarded: Or, how I learn to stop worrying and accept that 'no-cache' actually does cache.
Topic: Miscellaneous
12:47 am EDT, Aug 24, 2008
HTTP Caching is now added to my growing list of things that are Bretarded. Behold RFC2616:
no-cache
If the no-cache directive does not specify a field-name, then a cache MUST NOT use the response to satisfy a subsequent request without successful revalidation with the origin server. This allows an origin server to prevent caching even by caches that have been configured to return stale responses to client requests.
In other words, HTTP responses with a no-cache directive will actually be cached by downstream web caches. However when subsequent requests for that resource come into the cache, the cache must send a conditional GET to the original web server to check if the response it has cached is ok to serve.
So no-cache actually means cache, but revalidate.
... ok... so what about the must-revalidate directive?
must-revalidate
Because a cache MAY be configured to ignore a server's specified expiration time, and because a client request MAY include a max- stale directive (which has a similar effect), the protocol also includes a mechanism for the origin server to require revalidation of a cache entry on any subsequent use. When the must-revalidate directive is present in a response received by a cache, that cache MUST NOT use the entry after it becomes stale to respond to a subsequent request without first revalidating it with the origin server. (I.e., the cache MUST do an end-to-end revalidation every time, if, based solely on the origin server's Expires or max-age value, the cached response is stale.)
Great, so must-revalidate actually means the cache must send a conditional GET to the original server to revalidate the cached respoinse, but only if that response is stale. IF the cache still thinks the response is "fresh" it can serve a cached response regardless of the "must-revalidate" header.
Welcome to the fucked up world of HTTP caching! Of course, all this craziness is based on the premise that User-Agents can tell caches to give them stale resources. Which was probably a fairly bad idea in the mid-90s "the web is a series of static documents connected by hyperlinks" view of the world, and is an utterly horrible idea in the Web 2.0 view of the world.
There are absolutely no good comprehensive resources that explain HTTP caching directives, cache hierarchies, resolving HTTP/1.0 and HTTP/1.1 directives, etc. Where is a 96 page $39.99 O'Reilly book when you need one?
What is it with new Hollywood movies re-using the scores/themes from movies that are only a decade old?
Take Babylon AD. It uses the violin score from "Requiem for a Dream."
And The Watchmen is even more blatant. They are using Smashing Pumpkins "The Beginning is the End is the Beginning" which is off the Batman and Robin soundtrack and is a reworking of the theme song from that movie.
Don't get me wrong, I always enjoyed "The Beginning is the End..." more so than "The End is the Beginning..." but come one Hollywood, lets get original!
The only thing more painful than reading a new org chart of people 2+ levels above you, is having to attend a meeting where someone reads this org chart to you.
I read part of Kissinger's seminal work Diplomacy in college. I've been reading it recently because his freakishly dense vocabulary and odd sentence structure can really help put you to sleep, especially the parts about 16th century European military alliances. The book get much better and loses its sleep-inducing properties once it hits the Cold War, but even if the topic is interesting, Kissinger remains dry and sterile.
And so I almost missed this gem when reading tonight. Behold from chapter 28, page 708:
The assurance that America would keep its commitments was boilerplate; like professions of chastity, it has limited plausibility since its abandonment is unlikely to be announced before the event.
Freaking awesome. Henry Kissinger embedded a sexual analogy in the middle of discussing the difficulties of leaving Vietnam. How funny and inappropriate all at the same time.