I'v defered all my CSS using
media="none" onload="if(media!='all')media='all'"
and images using yall.min.js
But PageSpeed Insights continues claiming it (and the images are visibles too)
How do I could optimize this?
Thanks, Ari
I'v defered all my CSS using
media="none" onload="if(media!='all')media='all'"
and images using yall.min.js
But PageSpeed Insights continues claiming it (and the images are visibles too)
How do I could optimize this?
Thanks, Ari
Copyright © 2021 Jogjafile Inc.
I'm using JavaScript to asynchronously load external CSS files. Similar to old solutions where one would put scripts before the closing
</body>tag, I'm now introducing data-attributes to create<link>tags, so they're made asynchronous automatically:HTML
jQuery
Additionally I distinguish in SCSS between above the fold CSS and backgrounds, fonts, print, ...
If you really want to put an effort in it, the above the fold CSS can go inline. But I find it rather tricky to pull this off on a larger project. So I'm fine with async loading backgrounds and fonts. However, for fonts it's now clear they're loaded afterwards, similar to a FOUC or call it "Flash of Loading Font". It's good to do some research on a solid substitute font so it doesn't change your layout too much.