Introduce PrefetchRedirectError flag
This CL introduces the PrefetchRedirectError flag. When enabled,
prefetch requests get a redirect mode of kError, instead of the default
kFollow. Consequently, prefetches that redirect are "cancelled", however
the corresponding redirect responses are not evicted from cache, and can
be matched later, which is our goal. The current proposal mentions that
redirect mode should be manual, with the goal being:
- To not follow redirects
- Store redirect responses in the HTTP cache
In Chromium, to satisfy the above conditions with kManual redirect mode,
we'd have to implement extra behavior to treat kManual requests differently.
We can satisfy the above conditions with kError in Chromium, and avoid the
extra special-handling work. This is sufficient for initial experimentation.
This CL also includes prefetch browsertests ensuring this behavior
is both correct, and tied to the flag.
[email protected], [email protected]
Bug: 988956
Change-Id: I449be39a02b3806d3ab14c45a6cb491fcab9bb66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1725554
Commit-Queue: Dominic Farolino <[email protected]>
Reviewed-by: Yutaka Hirano <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Cr-Commit-Position: refs/heads/master@{#683955}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index c4a94791..445b19a 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -2895,6 +2895,10 @@
flag_descriptions::kResourceLoadSchedulerDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kResourceLoadScheduler)},
+ {"prefetch-redirect-error", flag_descriptions::kPrefetchRedirectErrorName,
+ flag_descriptions::kPrefetchRedirectErrorDescription, kOsAll,
+ FEATURE_VALUE_TYPE(blink::features::kPrefetchRedirectError)},
+
#if defined(OS_ANDROID)
{"omnibox-spare-renderer", flag_descriptions::kOmniboxSpareRendererName,
flag_descriptions::kOmniboxSpareRendererDescription, kOsAndroid,