I have a large JSON blob I would like to have preloaded with my webpage. To do this, I have added <link rel="preload" as="fetch" href="/blob.json">
to my page. I also have a JS request to fetch the same blob.
This does not work, and the console reports:
[Warning] The resource blob.json was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.
MDN claims that this can be fixed by adding crossorigin
to the link tag. AFAICT, this is not true, and no combination or crossorigin attributes will actually make it work.
Using the copy-as-curl command from the developer console, it seems like there is no combination of link tag plus attributes that will issue the same request as a fetch/XHR call in JS.
I would love to be wrong about this.