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

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

Issue 1287073007: Reuse images already loaded in the current document more aggressively (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | Source/core/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 7df5fd157395b48b3b5fe739197e389275547e59..aff41de2923c392a31216dd42a7a5d5763a0533e 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -572,10 +572,6 @@ ResourceFetcher::RevalidationPolicy ResourceFetcher::determineRevalidationPolicy
if (existingResource->isPreloaded())
return Use;
- // Defer to the browser process cache for Vary header handling.
- if (existingResource->hasVaryHeader())
- return Reload;
-
// CachePolicyHistoryBuffer uses the cache no matter what.
CachePolicy cachePolicy = context().cachePolicy();
if (cachePolicy == CachePolicyHistoryBuffer)
@@ -637,6 +633,10 @@ ResourceFetcher::RevalidationPolicy ResourceFetcher::determineRevalidationPolicy
if (type == Resource::Image && existingResource == cachedResource(request.url()))
return Use;
+ // Defer to the browser process cache for Vary header handling.
+ if (existingResource->hasVaryHeader())
+ return Reload;
+
// If any of the redirects in the chain to loading the resource were not cacheable, we cannot reuse our cached resource.
if (!existingResource->canReuseRedirectChain()) {
WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to an uncacheable redirect");
« no previous file with comments | « no previous file | Source/core/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698