Preload key requests
See original GitHub issueLight House is suggesting that I preload key requests, specifically the two google fonts that I’m using in my React app. Currently I’m just importing them like this:
@import url('https://fonts.googleapis.com/css?family=Open+Sans|Roboto:700')
I’ve been looking for an example of how to do this but, everything I’ve tried doesn’t seem to work. Any suggestions would be much appreciated.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
Preload key requests - Chrome Developers
Declare preload links in your HTML to instruct the browser to download key resources as soon as possible. ... With preload links, styles.css...
Read more >Lighthouse: Preload key requests - GTmetrix
Using <link rel="preload"> can help you prioritize important requests, resulting in a faster page load. This is because key resources may sometimes be ......
Read more >How to Preload Key Requests in WordPress (PageSpeed Item)
Preloading key requests instructs browsers to download your critical resources as soon as possible. In WordPress, preload is most commonly ...
Read more >Preload key requests WP Rocket | How-to Guide - Bobcares
Preloading key requests includes informing the browser to download the critical assets by prioritizing them. In other words, it ensures relevant ...
Read more >How to fix PageSpeed Insights' "preload key request" problem ...
The key preload request problem is an outcome of overusing this method. On checking your site with PageSpeed Insights, you might face some ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well I got it to work with this bit of code:
Without adding the crossorgin property to the second link tag I get a render blocking stylesheet warning from LightHouse but, this whole endeavor to preload font fonts per Light House’s suggestion as upped my first meaningful paint to 3620ms from 2650ms and lower my lighthouse score from 88 to 79. Not sure if the preload suggestion is general and doesn’t work with the way Google serves their fonts or if I’m still doing something wrong. Just frustrating to follow these optimization guide-lines and end up with a slower product.
Sorry I missed this reply @wildpow thanks for sending over the reports!
This is a very interesting case, the successful preloading improves First Contentful Paint as expected, but First Meaningful Paint gets worse because of a quirk in its implementation (the same quirks that were the rationale for decreasing its priority/weight in v3 and promotion of FCP in its place). The regression in the other metrics seems to be unrelated to the preload change and looks like natural variance. If we had been tracking FCP in v2, the incremental improvement from preloading would have been reflected there.
Thanks for bringing this up and sorry for the confusion! Hopefully these cases are addressed in v3 with the new prioritization/metrics 😃