-
Notifications
You must be signed in to change notification settings - Fork 53
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 page speed #1421
Comments
IE7 and IE8 accounted for 0.008% of sessions in Q4 2020. Supporting them isn’t worth the complexity it adds to the codebase. Part of #1421.
Looks like the `no-js` class on the html element was a leftover from Modernizr.js, which was removed in 2019 (d12d92b). We have styles which rely on a `js` class being added to the body element, so I’ve kept that, but moved the piece of JavaScript which adds the `js` class to right after the opening of the body element, which should make it run earlier than its previous location in main.js. Part of #1421.
* Move all `<script>` tags from middle of `<head>` to end of `<body>` * Add caching timestamps to all `<script>` tags * Remove riveted, scrolldepth, and engagement tracking * Remove unused jquery.fittext plugin * Move assorted JavaScript bits from end of footer.php to main.js Part of #1421.
It’s tempting to combine the 600 and 700 weights into one, but 600 (currently used for headings) doesn’t provide enough contrast with body text when use, for example, in `<strong>` tags, and 700 (currently used for `<strong>` tags) is too heavy for headings. Part of #1421.
I’ve started work on this in the |
Cut down on some cargo-culting :-) No need for the viewport tag to forbid user scaling. `width=device-width` is also optional these days, as mobile browsers just do the right thing by default.[1][2] Only initial-scale is required. [1]: h5bp/html5-boilerplate#1099 [2]: GoogleChrome/lighthouse#641 (comment) (Note also no need for `HandHeldFriendly` meta tag, since that was only for some old Blackberry devices, no need for `MobileOptimized` since that was only for very old versions of Windows Mobile, and no need for a `X-UA-Compatible` tag since IE will automtically render in Standards Mode when a valid <!doctype> is present and the user hasn’t set any browser options to always render in compatibility mode.) While I was there, I tidied up the charset tag too, although we serve theyworkforyou.com with a charset HTTP header, so most browsers will ignore this in-page tag anyway. Part of #1421.
These sidebars were the last place we were using Foundation.js (for its Magellan sticky positioning module) so replacing them with position:sticky means we can drop all Foundation JavaScript. Position:sticky requires a full height parent element, so we upgrade the MP page .person-panels to use flex layout, which gives us full height columns automatically. One thing we’ve lost with the removal of Foundation Magellan is highlighting of the "current" sidebar link. We could do this via the IntersectionObserver API if we wanted, but for now I’m not sure it’s worth it. Part of #1421.
IE7 and IE8 accounted for 0.008% of sessions in Q4 2020. Supporting them isn’t worth the complexity it adds to the codebase. Part of #1421.
It’s tempting to combine the 600 and 700 weights into one, but 600 (currently used for headings) doesn’t provide enough contrast with body text when use, for example, in `<strong>` tags, and 700 (currently used for `<strong>` tags) is too heavy for headings. Part of #1421.
Cut down on some cargo-culting :-) No need for the viewport tag to forbid user scaling. `width=device-width` is also optional these days, as mobile browsers just do the right thing by default.[1][2] Only initial-scale is required. [1]: h5bp/html5-boilerplate#1099 [2]: GoogleChrome/lighthouse#641 (comment) (Note also no need for `HandHeldFriendly` meta tag, since that was only for some old Blackberry devices, no need for `MobileOptimized` since that was only for very old versions of Windows Mobile, and no need for a `X-UA-Compatible` tag since IE will automtically render in Standards Mode when a valid <!doctype> is present and the user hasn’t set any browser options to always render in compatibility mode.) While I was there, I tidied up the charset tag too, although we serve theyworkforyou.com with a charset HTTP header, so most browsers will ignore this in-page tag anyway. Part of #1421.
All deployed. webpagetest shows gentle improvement: |
A few ideas:
<script>
tags that expect$
to be defined.respond.js
in an IE6–8 conditional comment – or remove it entirely. (IE 6–8 accounts for less than 0.1% of visits.)document.body.className…
JS snippet at the top of the body to add a JS class for CSS to use.foundation.reveal.js
in the footer.custom.modernizr.js
entirely.foundation.magellan.js
(andfoundation.js
itself!) with our own sticky sidebar solution – using CSSposition: sticky
andintersectionObserver
s for highlighting the current page section.300
at all in our CSS, and we could probably replacefont-weight: 600
withfont-weight: 700
without much visual difference.The text was updated successfully, but these errors were encountered: