<link rel=preload as=image href=""> tags are useless. The url is correct, and it does display, but it’s fetched a second time, the preloading doesn’t fail but it is said:
the resource xxxxx was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it has an appropriate
as value and it is preloaded intentionally.
The same happens with font preloading.
<link rel=preload as=font href="/fonts/roboto-bolditalic.ttf" type="font/ttf" crossOrigin>
I tried with or without crossOrigin.
I know that images and possible fonts too, are located on “https://d33wubrfki0l68.cloudfront.net/cfad9e8f17a6a86c333b824d173d3a05ac59a525/5e643/” in that case. I don’t know why. But it might be that because the domains are different, the browser can’t use the preloaded resources.
Please tell me how to solve this, what attributes to write
I read that
Crossorigin is said to be necessary when the font files are on another server/domain yet it’s necessary for preloading self-hosted font files.1 Dec 2021
so it should suffice. but it does nothing. Ergo it’s Netlify’s problem.
can you try reversing
href="/font.tttf" in your code? it may be the order. let us know how that goes!
No I won’t, because I found the issue. At least it can be replicated for the fonts, not so much with images ? But those images are responsive unlike before so it’s not exactly the same situation.
What I didn’t inform you before, because I forgot - it’s automatic - is that all the addresses were relative. Instead of copying my template, I should dig in the source of an html file. before there was a dot after “.”, making it a relative address:
now, no more. it still downloads and uses it but that suffices to make him it’s another address apparently !
No, I was wrong. Why it suddenly worked, I don’t know, but now It doesn’t… yet again, same thing. With cloudfront URL inserting themselves in img elements, though it does this in one site and not another, despite identical builds. Dammit !