by SquareWheel · 10y ago · 0 comments
The one recommendation both offer is eliminating blocking CSS by inlining it. I'm really not sure it's worth making a mess of your DOM by doing so. JS solutions exist, but that seems a pretty heavy approach.
Alas, the perfectionist in me wishes I could get a proper 100 in both tests...
I have a client that is hoping for a similar result. I worked for half a day to raise their mobile score from 60 to 71, eliminating all JS-related concerns.
Then I ran the test again without making any changes. The JS section was still gone, but the score changed to 59.
It really sucked to write that one up to the client; luckily they are pretty patient.
I find this approach is a lot messier than having an external sheet as it means splitting up "essential" and non-essential CSS, and it creates duplicate code. The CSS and HTML become more inter-dependent and less cacheable as a result.
It would be very cool to see a technology emerge that allowed CSS files to be sent in parts. The server might know which pages require which sections of code and prioritize those. The rest could be sent after everything else has loaded for future pages, or some sort of AJAX interaction. Mostly just thinking out loud, but it seems like there's better solutions to this one.