lodash / lodash.com

The Lodash website.

Home Page:https://lodash.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Preloading fontawesome twice

Munter opened this issue · comments

_headers generates preload hints for the fontawesome font in both .woff and .woff2, which makes preload supporting browsers download both files even though only one of them will ever be used.

Support for preload is a subset of support for woff2, so any browser that will execute on these hints will only ever need the .woff2 version of the font.

The savings of not preloading the .woff file are about 95kb, which is roughly one quarter of the full download size of the docs front page

I suggest filtering out anything except .woff2 when creating the preload hints. I would send a PR, but my current laptop can't run jekyll properly, and I'm not comfortable with trying liquid filtering blindly

Hi @Munter!

Is this resolved with #190?

Not quite. This is about the .woff font-file, not the CSS. What the above basically boils down to is preloading .woff make no sense when .woff2 is available, since the only browsers that have preload support also have .woff2 support and will always chose that over .woff.

Preloading .woff in lodashes case literally just adds another 95kb of dead code to the download of preload capable browsers

Ah okay, thanks!

Update:

Patched 2b15255