Summary: | Speculative revalidated request returns 200 instead of 304 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||||||
Component: | WebKit2 | Assignee: | Chris Dumez <cdumez> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | bugs-noreply, cdumez, koivisto | ||||||||
Priority: | P2 | ||||||||||
Version: | WebKit Local Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Carlos Garcia Campos
2016-06-01 02:31:39 PDT
I am investigating but I will likely need help testing a fix. Created attachment 280244 [details]
Patch
Created attachment 280245 [details]
Patch
Comment on attachment 280245 [details]
Patch
Carlos, could you confirm this fixes the GTK unit test?
Created attachment 280290 [details]
Patch
(In reply to comment #4) > Comment on attachment 280245 [details] > Patch > > Carlos, could you confirm this fixes the GTK unit test? /webkit2/WebKitWebResource/response: OK Yes, thanks for the quick fix! Comment on attachment 280290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=280290&action=review Patch looks good to me. I'm not wk2 owner so please, wait until an owner approves this before cq+ it. Thanks! > Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:278 > - static const HTTPHeaderName headersAllowedToMismatch[] = { > - HTTPHeaderName::IfMatch, > - HTTPHeaderName::IfModifiedSince, > - HTTPHeaderName::IfNoneMatch, > - HTTPHeaderName::IfRange, > - HTTPHeaderName::IfUnmodifiedSince, > - HTTPHeaderName::CacheControl > - }; > - > - HTTPHeaderMap headersA = a.httpHeaderFields(); > - HTTPHeaderMap headersB = b.httpHeaderFields(); > - for (auto headerName : headersAllowedToMismatch) { > - headersA.remove(headerName); > - headersB.remove(headerName); > - } > + ASSERT(!actualRequest.isConditional()); > + ResourceRequest speculativeRequest = speculativeValidationRequest; > + speculativeRequest.makeUnconditional(); > > - if (headersA != headersB) { > + if (speculativeRequest.httpHeaderFields() != actualRequest.httpHeaderFields()) { Nice cleanup! Comment on attachment 280290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=280290&action=review Looks good > Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:-280 > - HTTPHeaderName::CacheControl Why no allow CacheControl mismatch? Wouldn't that disallow some cases that would be fine to use? (In reply to comment #8) > Comment on attachment 280290 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=280290&action=review > > Looks good > > > Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:-280 > > - HTTPHeaderName::CacheControl > > Why no allow CacheControl mismatch? Wouldn't that disallow some cases that > would be fine to use? CacheControl on requests is very rarely used. The only reason I had this code was for the reload case because WebCore sets a "Cache-Control: max-age=0" in some cases. Right now, there is no way WebCore sets "Cache-Control: max-age=0" without also setting conditional headers so keeping this code won't normally help. It could in theory be useful for XHR requests but I doubt Cache-Control is used a lot there. We can add it back if we see XHR requests using Cache-Control header. Committed r201600: <http://trac.webkit.org/changeset/201600> |