quicklink icon indicating copy to clipboard operation
quicklink copied to clipboard

Different Accept-Headers for prefetch (link rel="prefetch") and regular request

Open jacobloveless opened this issue 2 years ago • 0 comments

I believe this is lower level issue with the browser, but adding it here as well. When a prefetch is sent, the accept header does not fully match what the browser would send.

E.g. in Chrome 99.0.4844.51

Prefetch request has:

accept: application/signed-exchange;v=b3;q=0.7,*/*;q=0.8

But visiting the page results in an accept header of:

accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Since the accept header may be used to determine the response type (e.g. here the notation of avif would result in a differing set of HTML) , the prefetch is effectively unused

jacobloveless avatar Mar 08 '22 20:03 jacobloveless