-
Notifications
You must be signed in to change notification settings - Fork 4
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
Improve request parallelization, particularly on Chrome #1201
Conversation
Netlify Deployments: |
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.
Device | URL |
---|---|
mobile | https://ocw-hugo-themes-www-pr-1201--ocw-next.netlify.app/ |
Device | URL |
---|---|
mobile | https://ocw-hugo-themes-www-pr-1201--ocw-next.netlify.app/search/ |
Device | URL |
---|---|
mobile | https://ocw-hugo-themes-course-v2-pr-1201--ocw-next.netlify.app/ |
Not what you expected? Are your scores flaky? GitHub runners could be the cause.
Try running on Foo instead
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.
@gumaerc tried again and saw the intended behavior. We suspect using wrong urls before. Should be: |
What are the relevant tickets?
Related to #1196
Description (What does it do?)
This PR moves Google Tag Manager script to the top of
<head />
, as recommended:Why? The goal is to better parallelize network requests, particularly in Chrome. Previously, in Chrome, many requests were being queued after some CSS. Similar queueing seemed to occur in firefox, though to a much lesser extent.
Notes:
<link />
has this effect. But since putting GTM at the top is recommended anyway, I feel good about this change.How can this be tested?
Consequently, you can observe the behavior easily in Prod or on RC, but not on our default PR builds deployed with netlify (no
GTM_ACCOUNT_ID
) and not easily on localhost (http1.1, which is limited to 6 concurrent connections per host).To help test this change, I've made two separate PRs just for the netlify deployments:
main
branch netlify deployment, but withGTM_ACCOUNT_ID
set to the RC value.cc/move-gtm
branch netlify deployment, but withGTM_ACCOUNT_ID
set to the RC value.To observe old blocking behavior:
To observe new behavior: Repeat steps above, but use https://ocw-hugo-themes-course-v2-pr-1202--ocw-next.netlify.app/
Additional Tests:
Additional Notes
Because Lighthouse and PageSpeed Insights both use Chromium, I expect this to help or Core Web Vitals scores:
Lighthouse performance scores are variable, but they do seem better on
1200
link than on 1202` link. Try https://pagespeed.web.dev/ if you're interested.