link rel="preload" for svg image

9 0 5

Hi! I'm trying to preload an svg image using preload link, but in the network tab of the browser I see that the image gets downloaded twice, and I get a message in the console saying

A preload for '' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.

My code is:

  <link rel="preload" as="image" href="{{ 'sprite.svg' | asset_url }}" type="image/svg+xml" crossorigin>


Screenshot 2021-11-07 at 19.04.32.png

What am I missing?

Replies 0 (0)