Summary: | XHR CORS requests logged twice in the server | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Karl Sutt <karl> | ||||
Component: | Page Loading | Assignee: | youenn fablet <youennf> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | achristensen, beidson, cdumez, cgarcia, commit-queue, ews-watchlist, karl, koivisto, mike, rojasinate, webkit-bug-importer, youennf | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | Safari 12 | ||||||
Hardware: | Mac | ||||||
OS: | macOS 10.14 | ||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=199644 | ||||||
Attachments: |
|
Description
Karl Sutt
2019-07-04 00:31:56 PDT
A possible duplicate? Behaviour looks very similar at first glance. https://bugs.webkit.org/show_bug.cgi?id=199183 *** Bug 199183 has been marked as a duplicate of this bug. *** The two XHR requests might be one triggered by speculative loader, and another regular one. That would mean the speculative load is not reused for the regular one. Created attachment 373676 [details]
Patch
Comment on attachment 373676 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373676&action=review > Source/WebKit/NetworkProcess/cache/NetworkCache.cpp:281 > + return request.requester() != ResourceRequest::Requester::XHR && request.requester() != ResourceRequest::Requester::Fetch; Wouldn't we ideally want all loads that use speculative revalidation to only request once, not just xhr and fetch? (In reply to Alex Christensen from comment #6) > Comment on attachment 373676 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=373676&action=review > > > Source/WebKit/NetworkProcess/cache/NetworkCache.cpp:281 > > + return request.requester() != ResourceRequest::Requester::XHR && request.requester() != ResourceRequest::Requester::Fetch; > > Wouldn't we ideally want all loads that use speculative revalidation to only > request once, not just xhr and fetch? I think we want XHR/fetch loads to fully opt-out of speculative revalidation, since some headers might be generated dynamically. For page loads which bypass the HTTP cache, we should also probably disable speculative reload since the sub resources will probably bypass the cache as well. That is another fix I believe. Comment on attachment 373676 [details]
Patch
This could potentially regress warm PLT but let's try it. The alternative would be to only do speculative revalidation if the request headers were identical the last 2 times the resource was loaded.
Comment on attachment 373676 [details] Patch Clearing flags on attachment: 373676 Committed r247276: <https://trac.webkit.org/changeset/247276> All reviewed patches have been landed. Closing bug. (In reply to youenn fablet from comment #7) > (In reply to Alex Christensen from comment #6) > > Comment on attachment 373676 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=373676&action=review > > > > > Source/WebKit/NetworkProcess/cache/NetworkCache.cpp:281 > > > + return request.requester() != ResourceRequest::Requester::XHR && request.requester() != ResourceRequest::Requester::Fetch; > > > > Wouldn't we ideally want all loads that use speculative revalidation to only > > request once, not just xhr and fetch? > > I think we want XHR/fetch loads to fully opt-out of speculative > revalidation, since some headers might be generated dynamically. > > For page loads which bypass the HTTP cache, we should also probably disable > speculative reload since the sub resources will probably bypass the cache as > well. > That is another fix I believe. (In reply to youenn fablet from comment #7) > (In reply to Alex Christensen from comment #6) > > Comment on attachment 373676 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=373676&action=review > > > > > Source/WebKit/NetworkProcess/cache/NetworkCache.cpp:281 > > > + return request.requester() != ResourceRequest::Requester::XHR && request.requester() != ResourceRequest::Requester::Fetch; > > > > Wouldn't we ideally want all loads that use speculative revalidation to only > > request once, not just xhr and fetch? > > I think we want XHR/fetch loads to fully opt-out of speculative > revalidation, since some headers might be generated dynamically. > > For page loads which bypass the HTTP cache, we should also probably disable > speculative reload since the sub resources will probably bypass the cache as > well. > That is another fix I believe. I filed https://bugs.webkit.org/show_bug.cgi?id=199644 |