PSA: Changing `Accept` Header for prefetch (and SXG)

52 views
Skip to first unread message

Noam Rosenthal

unread,
Dec 13, 2022, 3:32:54 AM12/13/22
to blink-dev
Description:
So far we had a dedicated Accept header for prefetches. This causes issues, namely that "Vary: Accept" makes the browser unintentionally discard the prefetch (Shopify reported this).
The mitigation, as per the spec PR, is to match the prefetch Accept header with the frame accept header (what we send for standard navigation).

Notes:
- For now this applies only to same-origin/no-cors prefetches, as our frame Accept header is > 128 bytes, which would cause a preflight and thus a compatibility risk. Solving this gradually would allow us to look at how we can mitigate this for CORS prefetches as well, though it's a lower priority, as navigations are anyway not CORS.
- The SXG ?q= value for the frame Accept header was wrong (0.9), it should have been 0.7 like in prefetch. This patch matches the frame Accept header to use ?=0.7

CL:
https://chromium-review.googlesource.com/c/chromium/src/+/4069726

Bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=626081

Spec:
https://github.com/whatwg/fetch/pull/1485


Reply all
Reply to author
Forward
0 new messages