Hi All,
I just want to spot out that the code snippet on this url is bad:
It has been out there for so long that I hardly believe that no one ever spot it's not even working in browsers not supporting requestAnimationFrame.
This part fails with uncaught reference error:
var raf = requestAnimationFrame || mozRequestAnimationFrame ||
webkitRequestAnimationFrame || msRequestAnimationFrame;
To make it work well all raf function references should be prefixed by a "window."
It's an other question that I disagree with this rule. Why should I want my CSS to load asynchronously in such a tricky way? Especially if I don't want a FOUC anywhere on the page.
If this was so important for web developers then I suppose an async attribute would have already been introduced to standards like in case of scripts.
I think caching CSS in browser side or in a Service Worker is fully enough.
This script is overkill and ugly and it'd be better to remove from the page speed improvements suggestions.
Of course only in my opinion.
Regards,
Zsolt