When served from Netlify you can see the CDN for the fonts in the CSS, but not on the ‘link preload’ Does preload actually work or am I missing something?
The cloudfront URL’s are the result of asset optimization, as configured on your site’s deploy settings page most of the way down:
Things that get optimized (which don’t include the <link> tag at present) will get rewritten to cloudfront URL’s. HOWEVER all content we serve is served from a CDN - that’s just the CDN we use for optimized assets. All traffic from netlify comes from some part of some CDN
If you want things to be consistent, turn off that feature in our UI. But hopefully things work normally, even if they look a little weird in the source code?
We don’t have any immediate plans to work on this, but it’s something we may address in the future. Can you provide a link to the page where you’re getting the double asset loading? Thanks.
effectively, ANY asset optimization set in netlify’s build settings will likely cause this behavior. You can’t know the URL of the optimized assets during build time, so it’s impossible to change your references to point to just those.
We don’t have any plans to update this behavior at present, so you should choose one or the other (asset optimization or preloading) for best results on netlify.
To clarify what’s going on, the gets url rewritten to be hosted on the CDN, including the link to the font inside of the stylesheet. Unfortunately, the url rewriting doesn’t work on the . This means that the url for the preloaded font and the font in the css are different, essentially breaking preloading and downloading the font twice.
The real fix would be for netlify to update the url rewriter to also take into account which seems like it would be a small change.
The workaround is to disable the url rewriter (which is unfortunate because it’s nice to have things on a CDN).