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

Always load Google Fonts over HTTPS #6792

Merged
merged 2 commits into from Feb 20, 2018

Conversation

Projects
None yet
4 participants
@coliff
Member

coliff commented Feb 20, 2018

safer and faster

@DirtyF

DirtyF approved these changes Feb 20, 2018

Thanks.
We sould even preload the fonts to avoid FOUC.

@coliff

This comment has been minimized.

Member

coliff commented Feb 20, 2018

Agreed. I've started adding this to all the sites I work on:
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
Shall I add to this PR or do you want to add it?

@DirtyF

This comment has been minimized.

Member

DirtyF commented Feb 20, 2018

@coliff good idea, please do.

I was curious to benchmark if we could do better reading https://www.zachleat.com/web/23-minutes/

@ashmaroli

This comment has been minimized.

Member

ashmaroli commented Feb 20, 2018

@coliff Thank you for introducing me to preconnect!!
I was aware of preload and prefetch.., but preconnect, is a killer in its own right!!

TIL 🍻

@coliff

This comment has been minimized.

Member

coliff commented Feb 20, 2018

@ashmaroli -you're welcome! This blog post (https://www.cdnplanet.com/blog/faster-google-webfonts-preconnect/) has some good info about that - with evidence of the performance improvements.

@ashmaroli

This comment has been minimized.

Member

ashmaroli commented Feb 20, 2018

I gez we could preconnect to cdn.jsdelivr.net as well for <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />.. but that's story for a future PR 😃

@DirtyF

This comment has been minimized.

Member

DirtyF commented Feb 20, 2018

note for later : looking at the network waterfall in dev tools, fonts are not preloaded or cached. Might submit a PR to improve TTFB and global speed index.

As a result it's blocking the rendering:
https://webpagetest.org/result/170515_DB_196E/1/details/#waterfall_view_step1

@ashmaroli

👍

@DirtyF

This comment has been minimized.

Member

DirtyF commented Feb 20, 2018

@jekyllbot: :shipit: +site

@jekyllbot jekyllbot merged commit a59e0e3 into jekyll:master Feb 20, 2018

3 checks passed

WIP ready for review
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@coliff

This comment has been minimized.

Member

coliff commented Feb 20, 2018

note for later : looking at the network waterfall in dev tools, fonts are not preloaded or cached. Might submit a PR to improve TTFB and global speed index.

Yep, there's a few more things to be done to improve the performance. I just saw that the static assets (images and CSS) have a cache life of just 10 minutes. Would be good to increase that.
REF: https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fjekyllrb.com%2F&tab=desktop

@DirtyF

This comment has been minimized.

Member

DirtyF commented Feb 20, 2018

These must default GitHub Pages defaults, I guess there's nothing much we can do about it.

@DirtyF

This comment has been minimized.

Member

DirtyF commented Feb 20, 2018

@ashmaroli

This comment has been minimized.

Member

ashmaroli commented Feb 20, 2018

@coliff What's your take on using preload on a local copy of the Google Font file (it won't be changing thereafter) over preconnect?

@DirtyF

This comment has been minimized.

Member

DirtyF commented Feb 20, 2018

@coliff

This comment has been minimized.

Member

coliff commented Feb 20, 2018

@ashmaroli hmmm.. overall I think it might not be worth it. If you're hosting the fonts yourself it'll mean you're using GitHub Pages very short cache life (10 minutes rather than Google's CDN cache life of 365 days).

@coliff coliff deleted the coliff:patch-2 branch Feb 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment