Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preloading content via rel=preload returns "headers do not match"

I am trying to preload XML via:

<link rel="preload" href="http://xyz.local/at_de/cartware_3dpicture/index/profile/id/5637566859.xml/" as="fetch" type="application/xml"/>

I receive an error message:

A preload for 'http://xyz.local/at_de/cartware_3dpicture/index/profile/id/5637566859.xml/' is found, but is not used because the request headers do not match.

The file I am trying to preload is normally fetched via XHR:

enter image description here

The upper request header is from preload, the beneath request header is from the original XHR.

Thanks for helping me!

like image 866
Michael Leiss Avatar asked Feb 25 '19 15:02

Michael Leiss


1 Answers

Ran into the same problem, even after adding the CORS headers. In my case, the Accept header was the crucial difference. Unless they're exactly identical, Chrome won't use the preload. Your Accept header has a couple extra parameters, which might be the problem.

like image 106
Samuel Bierwagen Avatar answered Sep 19 '22 22:09

Samuel Bierwagen