FA preconnect and Google font chain reduction #1049
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Small performance fixes:
Specifically, the request chain to load our fonts looks like this right now:
![critpath-main](https://private-user-images.githubusercontent.com/16870466/272393646-492cae9b-2563-449b-912d-9408b107d8cd.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1MzIyMDEsIm5iZiI6MTcxOTUzMTkwMSwicGF0aCI6Ii8xNjg3MDQ2Ni8yNzIzOTM2NDYtNDkyY2FlOWItMjU2My00NDliLTkxMmQtOTQwOGIxMDdkOGNkLlBORz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI3VDIzNDUwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAwMzkzZjMzOWI4NTg4OGU2MTJhNjk2YTYzMDk0OWZiMTVmYmZhN2U2OTZkYWVkYTg3M2ZjNjAwYjk4MjY3NWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.k4TIl5J9-TeOBewZLQml_LH49C8KzPK6-AV4nAoBDKc)
This PR will change it to this:
![critpath-branch](https://private-user-images.githubusercontent.com/16870466/272393662-96a38f62-d45c-4e88-aa75-d0f5cc59877d.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1MzIyMDEsIm5iZiI6MTcxOTUzMTkwMSwicGF0aCI6Ii8xNjg3MDQ2Ni8yNzIzOTM2NjItOTZhMzhmNjItZDQ1Yy00ZTg4LWFhNzUtZDBmNWNjNTk4NzdkLlBORz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI3VDIzNDUwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJhYzhiOTRiMjc4MzJkMDkyZjhjZmFiNWM2MTA1YWJhYWJiZTE3MmZiMTc3M2JiOTM1N2RhNWE4YzRlMmM0NjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Sdo1arQPD1rtwwpPdcM7q3sZgaZMcDm6wuhF7IpH8O8)
It just removes one step for the google fonts; our css and our google fonts will now load in parallel, not in sequence. In Lighthouse testing on local, I see a small reduction in first content paint (-0.3s) and total blocking time (-10ms) and +2 points on the Performance statistic (76 to 78) -- I ran these tests multiple times so those are averages but the difference is very small from test to test. The FA preconnect is ... probably insignificant, but anything to help speed up FA loads.