Adding header code to pre-load two fonts
-
Hi,
I’m adding a line of code into my header based on a recommendation from Google’s Page Speed Insights tool.
I found this code example that I plan on using:
<link rel=”preload” href=”fonts/cicle_fina-webfont.woff2″ as=”font” type=”font/woff2″ crossorigin=”anonymous”>
(Source)
My question is related to the href URL. Should I be putting a full URL with https? Or just the shorter file path like in the example above?
When I view the recommendations for my site in Google Page Speed Insights and hover my mouse over the two files that it recommends pre-loading, it shows me a full URL including https.
But I just wasn’t sure if it matters, and which way will boost my site speed the most.
I did implement it with the full URL, including https, and it seems to have worked (Google’s tool is no longer suggesting I preload these files). But I just wanted to make sure it’s done optimally.
- The topic ‘Adding header code to pre-load two fonts’ is closed to new replies.