I have tested the speed of my website ebetterbooks, and found some errors that were causing the slow speed of the website, fixed almost all of them, except one that is, eliminate render blocking resources, can someone tell me how to fix it
<script src="/js/nav.js" defer></script>
CSS I have found no way to unblock. Just compress.
Googlefonts blocks the rendering and you can download them to your server and “unblock” them. https://gowebstatic.tk/fonts
CSS is blocking the page rendering until the css file(s) is fully loaded and ready to style the page.
The solution is mainly to only load resources that is applied in current page waiting to be rendered. Google has some info worth reading:
I’m curious about how this works. I may be misunderstanding it, but I’m thinking, whether the font is on your server, or Google’s, what difference does that make from the client point of view? They will still be downloading the font to their device, just from a different (remote) location.
Me too, ideally the client could have the Googlefont in cache already?
I suppose it is more likely with commonly used fonts, which other sites may use. But it’s the same for any cached content, the very first load can cause a block. My question is, how does having it on your server help the client? As the block is the delay in getting it to the client, from wherever.
Fetching fonts “locally” loads faster and reduce blocking. Using woffs does not show any “render blocking” messages for fonts in Page Insights and web.dev. By using woffs you can tailor your fonts to load only latin for an example. Using less font variants (cyrillic etc) reduces also the load time.
However, Google Fonts (and similar services) are third-party services. The caveat here is that browsers would need to make extra requests – one for your server, and one for the third-party server – to get all assets (including fonts) loaded for your application. Due to multiple external requests, this can affect performance