Quantcast
Channel: User Prayag Verma - Stack Overflow
Viewing all articles
Browse latest Browse all 39

Answer by Prayag Verma for Why doesn’t loading a CSS file asynchronously resolve PageSpeed’s ‘Defer unused CSS’ entry?

$
0
0

To resolve this issue, you will need to completely remove CSS rules which are not used in the page. Asynchronously loading CSS files will not help with resolving this issue

Hence, there is ambiguity with the naming of this recommendation which leads to confusion. This has been discussed in the issue - https://github.com/GoogleChrome/lighthouse/issues/6588

I agree with the issue author; I also see many people who read this label (ever since Google Pagespeed Insights started using Lighthouse) as that they still have render blocking CSS, when they don't (since this warning shows for any css, async or not, that is not used on the page). It gets worse because the page you link to for further info talks more about render-blocking and critical css than it does about "removing unused CSS". It also uses "Defer" in a the more typical sense (load async, not remove from page).

To resolve this confusion, Lighthouse team has decided to rename this recommendation as Remove unused CSS in upcoming releases ( Refer to https://github.com/GoogleChrome/lighthouse/pull/7235 )


Viewing all articles
Browse latest Browse all 39

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>