G
G
grabbee2022-01-19 22:56:24
Google Chrome
grabbee, 2022-01-19 22:56:24

Why does Chrome consider request headers different (Link preload) even though they are identical?

The browser sees the header, loads the resource, but it is not used. The application makes its request again. The browser loads itself a version. JS loads its own.

A preload for is found, but is not used because the request headers do not match.

And here is the most interesting. All headers are the same

resource request headers

Host: 127.0.0.1:8000
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"
Accept: */*
sec-ch-ua-mobile: ?0
User-Agent: ...
sec-ch-ua-platform: "Linux"
Origin: localhost:8080
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: localhost:8080
Accept-Encoding: gzip, deflate, br
Accept-Language: ru,en-US;q=0.9,en;q=0.8,ru-RU;q=0.7,fr;q=0.6

related resource request headers

Host: 127.0.0.1:8000
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"
Origin: localhost:8080
sec-ch-ua-mobile: ?0
User-Agent: ...
sec-ch-ua-platform: "Linux"
Accept: */*
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: localhost:8080
Accept-Encoding: gzip, deflate, br
Accept-Language: ru,en-US;q=0.9,en;q=0.8,ru-RU;q=0.7,fr;q=0.6

related resource request headers

Host: 127.0.0.1:8000
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"
Accept: */*
sec-ch-ua-mobile: ?0
User-Agent: ...
sec-ch-ua-platform: "Linux"
Origin: localhost:8080
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: localhost:8080
Accept-Encoding: gzip, deflate, br
Accept-Language: ru,en-US;q=0.9,en;q=0.8,ru-RU;q=0.7,fr;q=0.6


Link: URL; rel="preload"; as="fetch"; crossorigin="use-credentials",URL...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zettabyte, 2022-01-20
@Zettabyte

Try adding it to the request crossOrigin="anonymous"and see what happens.
Those. more or less like this:

<link rel="preload" href="/assets/styles.css" as="style" crossOrigin="anonymous" />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question