-
-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preload FontAwesome, JS and CSS #3057
Conversation
[ci skip] [skip ci]
[ci skip] [skip ci]
[ci skip] [skip ci]
[ci skip] [skip ci]
[ci skip] [skip ci]
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
Very excited to see this! Let's fix tests, then good to go IMO |
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
I thought that last code suggestion would for sure fix the tests :P |
I don't have time to work on core for the next few days, so if either of you have any ideas, please just push straight to the branch :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving tentative on the singleton comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also going to approve tenitive the singleton comment being fixed
[ci skip] [skip ci]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #2741
Changes proposed in this pull request:
Document
preload()
andpreloads()
methods to Frontend extenderThe benefits of preloading FontAwesome are that these would normally only be fetched when CSS parsing is complete, which is often.
Preloading JS and CSS only makes a difference if we're preloading FontAwesome already. Browsers classify preloads as higher priority requests, meaning they would stall downloads of our JS/CSS until these are done. Adding these as preloads prevents this, and they are all fetched at once.
Overall, preloading results in a consistently faster page load time. Almost always 100-150ms faster, sometimes reaching 200ms+. If/when themes and other extensions begin preloading their assets, this could increase further.
Reviewers should focus on:
My failure to write/comprehend PHP and my blatant disregard for helpers and simplicity.
Screenshot
With preloads
Without preloads
Confirmed
composer test
).Required changes: