I am trying to preload a binary asset to get it discovered by the browser earlier and hopefully speed up the rendering of that asset once the application is up and running.
Usually we're fetching that asset with a normal fetch and then reading there that response.
The problem I am facing is, once I add a <link rel="preload" as="fetch" href="my-asset-url" crossorigin="anonymous" /> things start getting weird.
The behavior I am seeing is that the browser is successfully discovering the asset early and preloads it correctly.
Then when the fetch in the app code executes (there is no network request going out - which what I would expect since it already preloaded it), the response for that fetch, however, is incomplete - it's returning a partial of what the response is expected (32,768 bytes - consistently out of 393,372 bytes).
I am unable to reproduce this behavior outside of our app code so far. But thought I'd ask to see if anyone might have seen similar behavior like this. Any idea what could cause this?
Aucun commentaire:
Enregistrer un commentaire