Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp

Issue 2341893002: Don't attempt to revalidate a Resource with a 304 response. (Closed)
Patch Set: Fix comment issues Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index 07532df95eb5102f6ac718cb61b68d87d8022689..7e9940e0f7079c3d4a0e23bb69e4adb54769528f 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -709,9 +709,17 @@ ResourceFetcher::RevalidationPolicy ResourceFetcher::determineRevalidationPolicy
return Reload;
// Certain requests (e.g., XHRs) might have manually set headers that require revalidation.
- // FIXME: In theory, this should be a Revalidate case. In practice, the MemoryCache revalidation path assumes a whole bunch
+ // In theory, this should be a Revalidate case. In practice, the MemoryCache revalidation path assumes a whole bunch
// of things about how revalidation works that manual headers violate, so punt to Reload instead.
- if (request.isConditional())
+ //
+ // Similarly, a request with manually added revalidation headers can lead
+ // to a 304 response for a request that wasn't flagged as a revalidation
+ // attempt. Normally, successful revalidation will maintain the original
+ // response's status code, but for a manual revalidation the response code
+ // remains 304. In this case, the Resource likely has insufficient context
+ // to provide a useful cache hit or revalidation.
+ // See http://crbug.com/643659
+ if (request.isConditional() || existingResource->response().httpStatusCode() == 304)
return Reload;
// Don't try to reuse an in-progress async request for a new sync request.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698