You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reload goes back in time (http cache issue?) #24385
Hmm, I could reproduce this in a build based on ea4e3ae, but not in a build based on 37ab273. Now the cached entry is always used and I never see the updated content.
This looks like it happens because http_network_or_cache_fetch calls HttpCache::store after a revalidation request that returns a non-306 response. That means there are two cached responses, and then reloading calls HttpCache::refresh when the new revalidation request returns a 304. HttpCache::refresh just returns the first cached response, which is the older one in this case.
I think we should make HttpCache store overwrite any existing complete response so that we only ever have one complete response and an arbitrary number of incomplete responses for a particular cache entry.
It's weird, on my Mac with python 3, it seems the server doesn't understand the if-modified-since request header, and responds with a 200 even though the resource has been modified...
Also note that the "need to revalidate" is calculated based on the Last-Modified header of the cached resource, so one really needs to create, or modify, the test.html file right before starting the manual test, since otherwise the cached resource will remain valid for quite some time(10% of the time elapsed since the file was modified).
Just FYI in case someone starts to wonder why the test cannot be reproduced anymore...
Still happens. I managed to get it to display b for one refresh, then it went back to a. Tested on Arch Linux x86_64, Servo built against commit 9d29017, profiling build.
(At least local files are immune... makes my job a lot easier.)
Activity
jdm commentedon Oct 7, 2019
Hmm, I could reproduce this in a build based on ea4e3ae, but not in a build based on 37ab273. Now the cached entry is always used and I never see the updated content.
jdm commentedon Oct 7, 2019
Nevermind, I can still reproduce it.
jdm commentedon Oct 7, 2019
This looks like it happens because http_network_or_cache_fetch calls HttpCache::store after a revalidation request that returns a non-306 response. That means there are two cached responses, and then reloading calls HttpCache::refresh when the new revalidation request returns a 304. HttpCache::refresh just returns the first cached response, which is the older one in this case.
jdm commentedon Oct 7, 2019
I think we should make HttpCache store overwrite any existing complete response so that we only ever have one complete response and an arbitrary number of incomplete responses for a particular cache entry.
Auto merge of #24388 - jdm:cache-fun, r=<try>
gterzian commentedon Oct 8, 2019
It's weird, on my Mac with python 3, it seems the server doesn't understand the
if-modified-sincerequest header, and responds with a 200 even though the resource has been modified...see some printed logs.
So I can't seem to hit the refresh case.
Also note that this occurs because the python server by default sends a response containing a
Last-Modifiedheader(and also aDate).I think a more appropriate fix could be to find the "right" stored resource to use in the refresh operation, by comparing the stored
Last-Modifiedheader with the one from the 304 response, as described at https://tools.ietf.org/html/rfc7232#section-2.2.2 in the second "or" paragraph(see also the use of theDateheader in there).gterzian commentedon Oct 8, 2019
Also note that the "need to revalidate" is calculated based on the
Last-Modifiedheader of the cached resource, so one really needs to create, or modify, thetest.htmlfile right before starting the manual test, since otherwise the cached resource will remain valid for quite some time(10% of the time elapsed since the file was modified).Just FYI in case someone starts to wonder why the test cannot be reproduced anymore...
Auto merge of #27417 - jdm:clear-reload, r=Manishearth
Auto merge of #27417 - jdm:clear-reload, r=Manishearth
Auto merge of #27417 - jdm:clear-reload, r=Manishearth
Auto merge of #27417 - jdm:clear-reload, r=Manishearth
Auto merge of #27417 - jdm:clear-reload, r=Manishearth
Auto merge of #27417 - jdm:clear-reload, r=Manishearth
lumiscosity commentedon Jul 26, 2025
Still happens. I managed to get it to display b for one refresh, then it went back to a. Tested on Arch Linux x86_64, Servo built against commit 9d29017, profiling build.
(At least local files are immune... makes my job a lot easier.)
net: Replace all matching HTTP cached resources when revalidating (#4…