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

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..a5207ec197048ef824733c296ce550e812535749 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -572,6 +572,11 @@ ResourceFetcher::RevalidationPolicy ResourceFetcher::determineRevalidationPolicy
if (existingResource->isPreloaded())
return Use;
+ // List of available images logic allows images to be re-used without cache validation. We restrict this only to images
+ // from memory cache which are the same as the version in the current document.
+ if (type == Resource::Image && existingResource == cachedResource(request.url()))
Nate Chapin 2015/08/14 23:33:39 Moved here to make it equivalent to preloading. I'
+ return Use;
+
// Defer to the browser process cache for Vary header handling.
if (existingResource->hasVaryHeader())
return Reload;
@@ -632,11 +637,6 @@ ResourceFetcher::RevalidationPolicy ResourceFetcher::determineRevalidationPolicy
return Reload;
}
- // List of available images logic allows images to be re-used without cache validation. We restrict this only to images
- // from memory cache which are the same as the version in the current document.
- if (type == Resource::Image && existingResource == cachedResource(request.url()))
- return Use;
-
// 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