|
|
|
|
|
by daxterspeed
1456 days ago
|
|
HTTP has some strange rules about using stale caches so usually you want to add must-revalidate to your cache-control header. That ensures that the browser must revalidate once the cache goes stale. 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.