How To Speed Up Web Pages Loading

Actions
How To Speed Up Web Pages Loading
Srdjan Kali

Article by

Srdjan Kali

Mar 2, 2018

Test and improve your site's speed.

Sites that want to have high performance should take care of the order in the code and places where styles and scripts are called. Just as recalling an external CSS at the bottom of the page slows down the page load, moving it to the HEAD part eliminates that problem.

Scripts (external JavaScript files) cause a similar problem, but the solution is the opposite; it's better to move scripts from top to bottom as low as possible. The reason for this is to allow for the progressive loading (rendering) of the page, and the other is to achieve a greater parallelization of the download.

When it comes to external CSS, progressive loading is blocked until all styles are loaded. That's why it's best to move the styles call into the HEAD part of the page so they'll be the first to download. With scripts, progressive loading is blocked for all content below the script. Scrolling as close as possible means that the contents, above the script, will be preloaded.

Another problem that causes scripts is blocking parallel downloads. The HTTP/2 specification suggests that browsers do not download more than two components in parallel per host. For example, if images are loaded with multiple hosts, it is possible to get more downloads in parallel. However, as the scripts are downloaded, the browser will not start any other downloads, even on different hosts.

In some situations, it is not easy to remove images to the bottom. If, for example, the script uses document.write to load part of the page content, then the script cannot be moved to the bottom. There may also be a problem with the scope. In many cases, there are ways to resolve these situations.

An alternative proposal that is considered is the use of "deferred scripts". The DEFER attribute indicates that the script does not contain document.write, which suggests that the browser continues to load the page. Unfortunately, Firefox does not support the DEFER attribute. In Internet Expo, scripts can be delayed, but not fully to be desired. If the script can be delayed, it means it can also move to the bottom of the page. These are some tips to speed up web page loading.

Our advice is to test your site's speed and performance and improve it by following these guidelines.

Follow me on Twitter - @SrdjanKali.

 

Comments (0)

You must Register or Login to post a comment

1000 Characters left

Copyright © GLBrain 2019. All rights reserved.