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)
Tracking
()
NEW
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.
Comment 1•12 years ago
|
||
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
| Reporter | ||
Comment 2•12 years ago
|
||
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. ;-)
Comment 3•12 years ago
|
||
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.
Updated•12 years ago
|
Component: DOM: Core & HTML → Document Navigation
Comment 4•12 years ago
|
||
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.
| Reporter | ||
Comment 5•12 years ago
|
||
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.
Comment 6•12 years ago
|
||
> 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.
Comment 7•12 years ago
|
||
(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?
Comment 10•10 years ago
|
||
Is the fix found at https://bugzilla.mozilla.org/show_bug.cgi?id=939729 any help?
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•