Open Bug 976045 Opened 12 years ago Updated 3 years ago

Force-Reload doesn't re-fetch cached resources loaded via XHR

Categories

(Core :: DOM: Navigation, defect)

26 Branch
defect

Tracking

()

People

(Reporter: kairo, Unassigned)

References

Details

I would expect that force-reload via Ctrl+F5 or Shift-Clicking the reload button would evict all resources loaded by the current page and reload them from the network, but apparently ones loaded via XHR are still fetched from the cache. I run into this again and again with http://arewestableyet.com/ which loads most of its info from JSON or other external files via XHR, and that info is updated once a day. If I load it a short time before it updates (usually the update runs between 1pm and 2pm Central European Time), then a force-reload after the update doesn't actually give me the new information. If I load the files feeding into that dashboard in different browsers and do a force-reload there, then a normal reload on the dashboard is enough to refresh to the current values, but that's a quite ugly workaround, esp. as there's quite a few files of data feeding into this one.
I suspect this is harder than it sounds :) also - you want to make sure you force a network refresh, not just clear the local cache of relevant items.. the difference is that a network refresh has end to end semantics - otherwise you might just end up with data from an upstream cache.
Component: Networking: Cache → DOM: Core & HTML
Sure, I don't know all details that happen when one does force-refresh a document, what I want (and I guess a user would expect) it "just" that it does the same to XHR-loaded resources as it does to images, iframes etc. that are part of the page. ;-)
We could keep the flag on the loadgroup even after the load is done, or something. But I'm not sure that most people expect the behavior you do. > as it does to images, iframes etc. that are part of the page What our shift-reload implementation does is that all loads that start before the load event fires are network refreshes. Loads after onload are just normal loads.
Component: DOM: Core & HTML → Document Navigation
And in particular, we don't do anything differently for XHR and the other loads you list; all that matters is when a load starts. If you "new Image" after onload, it might get loaded from the cache.
Well, all I really want is some way to reload this page and have all its data actually reload with the current contents of those files - without manually navigating to all the JSON files that feed into it and do a force-reload on them. This page loads all those resources in code called from window.onload, if that makes any difference.
> if that makes any difference It does. We're very explicitly _not_ forcing network refreshes on things done from onload or later... Probably the most important reason for that is that it would force refreshes on link clicks.
(In reply to Robert Kaiser (:kairo@mozilla.com) from comment #5) > Well, all I really want is some way to reload this page and have all its > data actually reload with the current contents of those files - without > manually navigating to all the JSON files that feed into it and do a > force-reload on them. This page loads all those resources in code called > from window.onload, if that makes any difference. you can certainly cachebust all the xhr loads from that page (reloaded or not). maybe that's too big of a hammer?
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.