by daxterspeed · 4y ago · 0 comments
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...
Personally I've opted for "stale only" caching, so everything is served with Cache-Control: max-age=0,must-revalidate and a Last-Modified header and the browser will always make corresponding If-Modified-Since requests. This means significantly more requests per page, even if the responses are mostly 304 Not Modified, but getting to avoid all forms of cache busting makes developing a lot nicer.
How expensive is that? I would naively have expected that comparing timestamps and sending a 304 was cheap to execute.
However if you are serving clients with highly restricted bandwidth you're probably going to want extremely cacheable resources (public, immutable) and perhaps even a completely different site architecture.