fac22 / microblogging_site-DASE

Building a microblogging website.
https://aqueous-atoll-96640.herokuapp.com/
2 stars 2 forks source link

Including Google font twice #29

Closed oliverjam closed 3 years ago

oliverjam commented 3 years ago

You're including the Arvo font from Google Fonts twice. Once in the HTML:

https://github.com/fac22/microblogging_site-DASE/blob/6397495c707a9b82bb09d4949693e9907317aa64/routes/home.js#L30-L32

and once in the CSS:

https://github.com/fac22/microblogging_site-DASE/blob/6397495c707a9b82bb09d4949693e9907317aa64/public/styles.css#L10

Either of these will work on their own; in fact the HTML version is preferred for performance reasons.

The browser will see the <link> in the HTML and start downloading as soon as the page begins to load. If you use @import in your CSS the browser has to first find the CSS file, download that, then start downloading the font when it sees the @import line. It's better to avoid this type of "waterfall" loading if possible.