github web-platform-tests/wpt merge_pr_49452

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
20 days ago

Ship PrefetchFollowsNormalCacheSemantics

This removes the "5-minute rule" for prefetches, where they ignore
normal HTTP cache semantics for 5 minutes and instead stay cached in the
HTTP cache. This applies to , NoStatePrefetch (i.e.

), and speculation rules prefetch.

Note that for speculation rules prefetch, because there is the separate
in-memory speculation rules prefetch cache, 2xx responses without
caching headers will still be stored in that in-memory cache. They just
won't be HTTP cached, in a way that was counter to the website's
expressed preferences.

Shipping this was approved back in May 2023, with an accompanying Finch
study to check for regressions 1. However, we forgot to actually
change the default.

This is of new urgency now because of the impact on speculation rules
prefetch, which is is causing web developer pain. A web platform test is
included for the specific painful scenario, which fails before this
change and passes afterward.

Most of this CL consists of test updates: many of our tests relied on
not needing caching headers to make or

work, and so do things like assume there will never be a second request to those URLs. The general fix is to apply caching headers to the resources in question, as that represents the intended real-world usage of . (And, to a lesser extent, the nonstandard and hopefully-one-day-removed .)

Notably, the WPT prefetch-document.html was failing in all browsers
before this, including in Firefox which has a highly spec-conformant
implementation. It should now be passing.

PrerendererImplBrowserTestPrefetchAhead.PrefetchSuccessPrefetchMatchResolverTimeoutPrerenderFailure
was disabled, since it appears to never have been working as expected,
with the HTTP caching hiding the real problem. Issue 372851198 tracks
fixing that test.

Tests specifically for the 5-minute rule were deleted.

Bug: 40232065, 381099745, 356624471, 372851198
Change-Id: I7d42c43efd89486587d8b7fc8ddd4412b31ef0bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6056830
Reviewed-by: Rakina Zata Amni rakina@chromium.org
Commit-Queue: Domenic Denicola domenic@chromium.org
Reviewed-by: Adam Rice ricea@chromium.org
Reviewed-by: Hiroki Nakagawa nhiroki@chromium.org
Cr-Commit-Position: refs/heads/main@{#1390213}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.