Created attachment 8758645 [details] Wrong expire time for immutable cache entries.mp4 Sorry I submitted by accident when still typing.
You may have to try quite a few times to reproduce this.
Thanks for the video - that helped diagnose. Let me summarize: 1.png is served with cache-control: max-age=60, immutable into an empty cache and then a navigation is made to the same html page, still containing 1.png and you see a 200 response from the network rather than a cache hit and you anticipate a cache hit. did I summarize that fairly? If you pause the video at 0:20 you will see an important piece of information - the first time 1.png is received it bears an Age: 105 header from the server. remember that max-age is 60. Therefore this response is already stale. and that explains why it is refetched from the network on the next use. cache fresheness, as defined by the specification, is the sum of the time it has spent in the local cache plus the Age header when compared to the lifetime (in this case from the max-age header). So it looks like some cache served a response that was already stale. immutable doesn't make a stale response fresh - it just means we don't need to ever revalidate it while it is fresh (e.g. when someone presses reload). I would expect most immutable responses to carry very large max-age, but some folks may want daily pings and what not and so max-age still makes a certain amount of sense - we just won't revalidate it when its fresh. so use a bigger max-age and you'll be fine :)