-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
should FetchEvent.request ever be a range request if we cannot verify if the underlying resource is the same? #1201
Comments
As far as I can tell the fetch spec does not indicate when the Range header should be added to the request. In gecko we only add it in "network or cache" path here: https://searchfox.org/mozilla-central/source/netwerk/protocol/http/nsHttpChannel.cpp#4208 @annevk, is this something fetch spec should include? |
Gecko bug for this issue: |
@wanderview yeah, @jakearchibald has some work-in-progress on range requests here: whatwg/fetch#560. |
Yeah, I need to pick that back up again |
That PR looks useful to clarify some things, but does it address the checking for change question? Maybe firefox is more conservative here, but we never use range request unless we can have some assurance that we're continuing the same resource from before. All the logic that enables that is in the http cache which sits below the service worker. |
@wanderview here's the other part of it whatwg/html#2814. I'll also work on how to resume downloads, which we also need for background fetch. You might be interested in my tests https://github.com/jakearchibald/range-request-test - Firefox is the only browser that does well. |
Thanks, I was also looking at: https://docs.google.com/document/d/1SphP-WNxqzZrSv_6ApC9_FpM-m_tLzm57oL3SNGg-40/edit# |
It seems that in firefox we avoid using partial response and range requests if:
See:
https://searchfox.org/mozilla-central/source/netwerk/base/nsIResumableChannel.idl#13
If we allow range requests through FetchEvent.request, how can we ever know if the underlying resource has changed? Normally we depend on the http cache to detect if a change has taken place, but we don't have that here. The service worker could return completely different data each time.
Does chrome have similar "detect if something changed" behavior for range requests?
The text was updated successfully, but these errors were encountered: