3 ms·
> the browser should use the cached object without making any requests. That's a common (mis)assumption, but that's not how it works in practise. Sorry ^^ I c
by user5994461 10y ago
> the browser should use the cached object without making any requests.
That's a common (mis)assumption, but that's not how it works in practise. Sorry ^^
I cannot comment on what was the intended behavior when HTTP caching and headers were first designed, a very long time ago.
It seems to me, that is was "request everytime + get 304 if not modified, thus save the file transfer time". That's how most implementations work in my experience.
Historically, transfer duration was way more problematic than latency. It's only recently that there are pages with hundreds of dependencies.
---
Rails and webservers: They MUST change the filename or the application will be fucked because of caching issues, mostly because of Firefox :D
- DivineTraube 10y agoAll major browsers do respect the TTL if one is set. So it does save many requests. If it's not possible to the the TTL because the content might change at any time it is still useful to a caching header with a TTL of 0. Otherwise the browser will perform heuristic caching and compute a (often imprecise) estimation based on the last-modified header.
- bzbarsky 10y ago> but that's not how it works in practise As someone who has actually worked on a browser's network stack, I can assure that it _is_ how it works in practice.