Also it often gives crazy advices, for example something like "embed CSS code necessary to display the top of the page, right into the page". Not only it is difficult to implement, (what exactly is "the top of the page"? how to understand what part of the code is necessary? what if the user scrolls the page down while loading?), it will make the pages larger and doesn't allow browser to cache embedded CSS. So you have to invest a lot of time and your page will probably load slower as a result.
But at the same time this script doesn't notice obvious things. For example, it never advices to remove or replace web fonts although web fonts are heavy, can cause problems with rendering text (they can lack glyphs, for example cyrillic or CJK characters) and web fonts block text rendering. And they are really unnecessary in most cases because builtin system fonts usually look better at small sizes (at least on Windows).
Also it never advices to remove ads althogh ads often cause high CPU and memory consumption. Why is that I wonder.
The tool always requires to move JS scripts to the bottom of the page. But is it always the best idea? I think in most cases it is not. For example, if you have a button with an onclick handler, it will give a JS error if the button is clicked before the scripts in the bottom of the page have loaded (the problem of dead JS controls). And if you put a small JS script at the top of the page, there will be no error. And what if you have a SPA? In this case the earlier you start to load the scripts the sooner the user will be able to see the data.
Also it always recommends to use a CDN which is not always good idea. For example, if you have a site in Russia or China and move your static files to CDN then it might be farther from the user than your server and even worse, it can get blocked so your site won't even be loading. Adding a CDN often doesn't make performance any better but reduces the reliability and increases your hosting bill.
So Google's script might help you in identifying problems with your site but you should not ever blindly trust any of the recommendations. Please leave client side optimization to people who have expertise in this area.
By the way I had to lessen the image quality to get a better score (and foolow other useless or even harmful recommendations) because our management believes that the score given by this tool (it is Google's official tool after all) affects SEO rankings and obviously they are more important than image quality.
The article says "Then, inline your CSS and JS instead of making external resource calls to them." and this is actually what makes your page heavier.
> Finally, I was having a lot of trouble getting the Google Analytics script on my site to not be render-blocking
It is easy. Don't understand what was the trouble.
it often advices to compress images and even suggests to download "optimally" compressed versions
Compressing images is useful, and this advice can be beneficial – though I'm sure it's more effective to optimise them yourself rather than relying on the Google-generated versions.
"embed CSS code necessary to display the top of the page, right into the page".
This is good advice. For larger sites with more extensive stylesheets, this approach allows the initial 'above-the-fold' to be rendered better before the full stylesheet is loaded. Just because it doesn't hit every case – like when users scroll during load – does not render it ineffective. It's also neither difficult to implement, nor does it add enough load time to pages to be a practical issue (unless you're inlining 100kB of text, in which case – rethink your stylesheet!)
For example, it never advices to remove or replace web fonts
It would be a bit silly to do so; web fonts are added on purpose, and advising that they be removed is pretty useless advice, along the lines of "you can speed up your website by removing images". It would be nice if the tool supported analysis of web font use though, such as testing to see if particular styles are used, or if the font could be effectively subsetted.
Again, it would be useless information to tell someone who has deliberately added advertising to their website to remove it.
The tool always requires to move JS scripts to the bottom of the page. But is it always the best idea? I think in most cases it is not.
Yes, it is – either that, or loading the scripts deferrably or asynchronously.
it will give a JS error if the button is clicked before the scripts in the bottom of the page have loaded
And what if you have a SPA? In this case the earlier you start to load the scripts the sooner the user will be able to see the data.
If you have an SPA, then either there is no real markup on the page (and the difference will be minimal) or you are pre-rendering it, and the content will be visible anyway.
Also it always recommends to use a CDN which is not always good idea.
Using a CDN is almost always a good idea unless you have a very specific reason not to do so.
I would say this much is obvious – it's a tool, and like any others, experienced professionals can use it to make appropriate decisions. It can help with that.
SEO rankings and obviously they are more important than image quality.
The unfortunate thing is that they probably are!