1

I've improved many issues that Google pagespeed tool reported and now the main issue is the following: Eliminate render-blocking JavaScript and CSS in above-the-fold content opencart

I am using OpenCart and didn't understand exactly how to fix the problem, and how exactly prevent from things to cause problems/dissappear/etc, after making this change..

Do you have a suggestion of how you deal with it? A specific JS that solved it? A tutorial that will clear things up for me?

I've tried a few on Youtube and Google but didn't understand exactly how to approach it.

Currently this is the site's status and last report from Google:

https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fswing-and-play.com%2F&tab=desktop

3

2 Answers 2

4

I'm not familiar with OpenCart, but basically what this warning means is that you have many js/css files loaded when the page loads.

this is blocking page rendering until all js/css files are loaded. In order to deal with it you need to do several things:

  1. Concat js/css files into 1-2 files and minify them - that way you reduce the number of http requests and loading time of the page.
  2. if possible, move js files to the bottom, right before the closing body tag.
Sign up to request clarification or add additional context in comments.

Comments

1

well, you should first put all javascript at the end of the html file, just before the closing BODY tag. Failing to do so means that the browser will wait for the files to be downloaded before proceeding with rendering the screen, thus provoking a longer waiting time for the user. Then, you should combine them all to have just one file, thus only one http request. Then, you could minify them to save extra kilobytes.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.