Commit 839ea8c6 authored by Takashi Toyoshima's avatar Takashi Toyoshima Committed by Commit Bot

Stop activating cache-aware loading on pages controlled by service worker

Cache-aware loading is an internal optimization and implementation
details that should not be exposed to the fetch event. That makes
a hidden request in order to check cache entry existence for legacy
sites, but it is useless for modern sites that enables service worker
to optimize such resource loading by hands.

This patch just stops using the cache-aware loading on service worker
enabled pages. It solves the problem that expose the hidden request
to the fetch event, and does not cause real world performance impact.

Bug: 750612
Change-Id: I8c698ae259274482d35cdbb5abde84c946652cfd
Reviewed-on: https://chromium-review.googlesource.com/725026Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509727}
parent 859ffed5
...@@ -742,6 +742,10 @@ void ResourceLoader::ActivateCacheAwareLoadingIfNeeded( ...@@ -742,6 +742,10 @@ void ResourceLoader::ActivateCacheAwareLoadingIfNeeded(
if (request.GetCachePolicy() != WebCachePolicy::kUseProtocolCachePolicy) if (request.GetCachePolicy() != WebCachePolicy::kUseProtocolCachePolicy)
return; return;
// Don't activate if the page is controlled by service worker.
if (fetcher_->IsControlledByServiceWorker())
return;
is_cache_aware_loading_activated_ = true; is_cache_aware_loading_activated_ = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment