4 ms·
It would be far better to have user agents handle caching headers correctly instead of creating another configuration option (which will likely suffer from the
by manigandham 9y ago
It would be far better to have user agents handle caching headers correctly instead of creating another configuration option (which will likely suffer from the same implementation problems).
cache-control: private with either sliding or concrete expiration time already handles this.
- deleted 9y ago[deleted]
- foota 9y agoDoesn't that indicate though that the cached resource can't be shared?
- manigandham 9y agoThen use cache-control: public with a sliding or concrete expiration time. We can even set different expirations for middle proxies and end user clients.
- prolurker 9y agocache-control: private doesn't seem to imply that a resource won't ever change and on page refresh the browsers have to check if the resource has been updated, immutable would avoid the 304's responses cascade.
- manigandham 9y agoThat's the entire point of the expiration time. Use a 2 year range and it's effectively immutable. No content will stay on device forever anyway and headers can easily be set to a smaller time-frame or must-revalidate if the content owner wants it. Browsers mistakenly continue checking for new copies when they shouldn't within the expiration time. Fixing poor implementations with more standards never works well.
- prolurker 9y agoThe problem is that servers are allowed to update their resources at any time without waiting for any specific expiration time. So when a user instructs it's browser to refresh the page, usually expecting to get the most up to date version, the browser has to choose between giving the still valid, but maybe not completely updated, cached version or actually checking if the resource has been updated. Immutable makes it clear that the server won't update the resource in place and will handle updates by generating a new one so the browser can happily avoid checking those resources on page refresh.
- taeric 9y agoAnd many people are almost certainly going to find that they actually need to either recall an old immutable thing, or mutate it. Also, I will certainly want to clear out my browser's cache on a regular basis. I do not want it keeping immutable things just because they shouldn't ever change.
- Dylan16807 9y agoYou can't 'recall' something you already sent out to browsers, and if you need to mutate then it's easy to make a new URL. This header won't make browsers cache data any differently. It skips a step when the cache is being read from.
- taeric 9y agoBut in the current world, you can serve new content on the conditional check that caches currently do. That said, I am ultimately for this. I think. There is plenty of data showing that this is a low hanging fruit to hit.
- Dylan16807 9y agoThe conditional check that they do sometimes. Now half your users see the new version and half see the old version. Not much of a recall.