Open
Bug 1037721
Opened 11 years ago
Updated 2 months ago
Figure out whether we can get rid of the forceGet argument to location.reload
Categories
(Core :: DOM: Core & HTML, defect, P5)
Tracking
()
NEW
People
(Reporter: bzbarsky, Unassigned)
References
(Blocks 2 open bugs)
Details
(Keywords: dev-doc-needed, webcompat:platform-bug)
User Story
user-impact-score:20
It's not there in the spec.
| Reporter | ||
Comment 1•11 years ago
|
||
So both W3Schools and MDN claim the arg exists. However location.reload.length == 0 in every single non-Gecko-based browser I can find. And at least source inspection suggests webkit/blink don't have that arg.
In our tree, we have a dozen or two uses of reload(true) at first glance, mostly in tests. I don't know about non-literals being passed in, or extensions. :(
Updated•11 years ago
|
Keywords: dev-doc-needed
Comment 2•11 years ago
|
||
Interested to know Ilya Grigorik's take on this. I've seen him use location.reload(true) in examples.
Comment 3•11 years ago
|
||
The bug on the specification for adding this turned out to be INVALID. I didn't know it was only Gecko that supported this. Do please reopen that bug if the circumstances here change:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27764
Comment 4•11 years ago
|
||
FWIW, I do believe "forceGet" is being used in the wild by some popular sites. The general pattern is:
- http://www.stevesouders.com/blog/2012/05/22/self-updating-scripts/
- http://www.stevesouders.com/blog/2013/02/26/reloading-post-onload-resources/
- http://www.phpied.com/update-a-far-future-expiring-component/
Comment 5•11 years ago
|
||
"forceGet" always worked in Chrome because we make conditional requests on `location.reload()`, so we were able to cache-bust resources with a future max-age even without `location.reload(true)`. Appears that Firefox also makes conditional requests on `location.reload()`, so the boolean can be dropped and work as Chrome does now.
Maybe Firefox used to fetch resources with future max-age from the cache on `location.reload()`? That might explain why the boolean used to be useful.
| Reporter | ||
Comment 6•11 years ago
|
||
No, having the boolean false still forced cache revalidation via conditional request.
The boolean being true does a lot more than do conditional requests. It completely bypasses the cache, it forces creation of a new HTTP connection instead of reuse of an existing one, it disables pipelining on that connection, and if we're doing an HTTP 1.1 request sends a "Cache-Control: no-cache" on the outgoing request (and a "Pragma: no-cache" if doing HTTP 1.0), to bypass proxy caches.
The boolean being false will do "Cache-Control: max-age=0" on the request if HTTP 1.1, else also "Pragma: no-cache". And of course it'll force the use of a conditional request no matter what max-age our cache has. But it won't do those other bits.
Comment 7•11 years ago
|
||
Sorry, I wasn't clear. I was referring to the posts Ilya posted. I mean their techniques still work without boolean-true, because of the conditional requests, which is why they work in Chrome too.
Comment 8•7 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046
Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.
If you have questions, please contact :mdaly.
Priority: -- → P5
| Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•3 years ago
|
Severity: normal → S3
Updated•2 months ago
|
Keywords: webcompat:platform-bug
Updated•2 months ago
|
User Story: (updated)
Updated•2 months ago
|
Blocks: proprietary-dom
You need to log in
before you can comment on or make changes to this bug.
Description
•