Lock response.js and pageSpeed ​​/ page rank lock

In the React.js tutorial, he shows that his javascript files must be within the <head> , which does not allow the page to display until it finishes loading.

From this quick test, it seems that any website requiring a .js reaction does not bode well with google pageSpeed, as this is causing this problem. "Eliminate JavaScript and CSS visualization blocking in the above content"

My questions:

  • Does this really affect page speed?
  • This problem means that Google page rank will also be performed.
+7
javascript reactjs sync
source share
2 answers

To expand on @Bojangels comment: you better load React into the script tag immediately before the close </body> as follows:

 <html> <head> <title>This is my app!</title> </head> <body> <!-- Your body content --> <script src="https://fb.me/react-0.13.3.min.js"></script> </body> </html> 

Put the script at the end so that the rest of the html and CSS rules are displayed before the script tag is reached and react-0.13.3.min.js is loaded.

Also, as already mentioned, you can add the defer attribute to the script tag like this:

 <script src="https://fb.me/react-0.13.3.min.js" defer="true"></script> 

By adding the defer attribute, you should do the following (source: mdn ):

This Boolean attribute is set to indicate to the browser that the script is intended to be executed after the document has been parsed.

How much is your second question about whether page load speed affects google search rankings, Moz (SEO) wrote a post about page speed and ranking and conclusion:

Our data shows that there is no correlation between "page load time" (full or full), as well as ranking on the Google search results page.

+6
source share

There is npm to help you extract and embed the critical CSS path into HTML pages using webpack. Critical Webpack plugin: https://github.com/nrwl/webpack-plugin-critical

This helped me in React.js and allowed Optimize CSS Delivery after you learned about the properties of a Google page.

+2
source share

All Articles