PageSpeed Insights suggests me to:
"Eliminate external render-blocking Javascript and CSS in above-the-fold content. Your page has 1 blocking CSS resources. This causes a delay in rendering your page. Optimize CSS delivery for the following resources: http://itransformer.es/css/c0f9425.css"
The css file c0f9425.css
is the combined file with jquery-ui.css
file and custom one.
I don't really understand this point. How should I follow this suggestion?
When Google tells you to eliminate render-blocking resources, it's essentially saying, “hey, don't load unnecessary resources at the top of your site's code because it's going to make it take longer for visitors' browsers to download the visible part of your content”.
How do I eliminate render-blocking resources in WordPress? Try deferring JavaScript, generating critical CSS, and inlining it (usually done through a cache plugin or Autoptimize). Trimming the size of CSS and JavaScript files and delaying third-party code can also eliminate render-blocking resources in WordPress.
Google suggests you to put the initially needed (above-the-fold) CSS inline and load the rest of the CSS when the page load is ready. See here.
Same goes for the javascript. Include the "must have code" inline and load the "nice to have code" on page load as suggested here
Idea is to load what the user sees first as fast as possible.
Personally I find it hard to follow as it would split the code and makes maintaining it harder. Makes sense for large projects though…
I have successfully solved this problem with javascript files only.
Try adding the async attribute in script tag or defer attribute.
For example:
<script src="filename.js" async></script>
<script src="filename.js" async="async"></script>
or
<script src="filename.js" defer></script>
<script src="filename.js" async="async"></script>
I suggest you to use async, it loads the file only when needed. Defer attribute load the file at the end of the page, some time it will not perform its functionality required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With