An external style sheet will block the page from displaying until it is fully loaded. Google recommends placing the style necessary for the initially visible (critical, over the fold) part of the document inside the <style> tags in the head ( ), where you can define a non-inline style ) to avoid this blocking. A non-critical style (something that you don’t see directly when landing on the page) is added as an external style sheet inside the head after the HTML has been read. Thus, it is displayed first, and only then will all other styles be loaded. All in order to show the visitor the content as quickly as possible and not allow him / her to wait longer than necessary.
In most cases, most think that Google recommends, and they are just fancy for a few milliseconds - their approach only makes sense if the CSS is huge. But I find it difficult, if not impossible, to maintain existing tools. For example, if it’s a returning visitor who scrolls down the page and automatically lands there (Opera is a browser that is very stubborn with this)? For this you need more JS and maybe juggle with styles. This may not be a good way. And even for the initial display, you will have to type some media queries inside the head directly in order to try to correct the situation without resorting to full-screen sections. This is all counterproductive and abundant.
Using <style> or <link> tags outside the section of a chapter may work, but this is not true. I'm sure Google is no longer in that view, and that the English version is the only valid documentation. Edit - see Comments for a nuance.
Even if you do it differently and get a “good” score on the PageSpeed Insights page, that doesn't mean too much. You can still hide the entire page and show it only when everything has been loaded (which is not unusual), without affecting the result.
I personally decided to ignore it until they implemented a function in which you can load CSS asynchronously (for example, using JavaScript and async already), as announced in the documentation. This will still require special use, but at least you can create a structure for it. Not a fan of plugins for something pretty trivial.
The Google documentation is missing one important thing - providing a backup when JavaScript is disabled. Fortunately with HTML5, you can use the <noscript> tags for this:
<head> /* other stuff */ <noscript><link rel="stylesheet" href="small.css"></noscript> </head>
Sidenote - Google Script’s own analytics will prevent an excellent PageSpeed score due to the (logically) expiration of the fast cache installed on it. Drawing.
Shikkediel
source share