If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Wrong expire time for immutable cache entries

RESOLVED INVALID

Status

()

Core
Networking: Cache
RESOLVED INVALID
a year ago
a year ago

People

(Reporter: ziyunfei, Assigned: mcmanus)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox49 affected)

Details

(Whiteboard: [necko-active])

Attachments

(1 attachment)

(Reporter)

Description

a year ago
demo: https://asnokaze.com/demo/cache-control-immutable.html
(Reporter)

Comment 1

a year ago
Created attachment 8758645 [details]
Wrong expire time for immutable cache entries.mp4

Sorry I submitted by accident when still typing.
(Reporter)

Comment 2

a year ago
You may have to try quite a few times to reproduce this.
(Assignee)

Updated

a year ago
Assignee: nobody → mcmanus
Whiteboard: [necko-active]
(Assignee)

Comment 3

a year ago
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 :)
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.