Introduction

Waiting is always irritating and everyone hates to wait. This is not only true for our general life but it is also true for our websites and webpages. If your website or webpage takes too much time to load then it starts losing its visitors and customers. So we can say website loading time is a crucial factor to provide users a better experience.

Tips

1. Reduce Page Weight: One of the most important factors in page loading is the weight of the page. To reduce the page weight we use a minimization technique (eliminate unnecessary white space and comments) and by moving inline Scripts and CSS into an external file.

Now do you see how to reduce your page weight?

Page weight is nothing but the overall size of the files that the browser must download to display your website. So to reduce the weight of the page use the following tips:

2. Reduce domain lookups: The page loading time will be increase along with a number of separate domains. Mainly separate domains appear in CSS links, in JavaScript links and Image links. So it is a good practice that you should always take care to use only the minimum necessary number of domains in your webpages and don't use so many domains in your webpage.

3. Cache content can be reused: Always ensure that any content can be cached with some appropriate expiration times. Pay attention to the Last-Modified header. The Last-modified header allows efficient page caching. The Last-Modified entity-header field indicates the date and time at which the origin server believes the variant was last modified for the webpage. If the last modified date is different then the page will again be cached into the cache but if it is the same then the page will load quickly into the browser. Most web servers automatically append the Last-Modified header to static pages (for example .html, .css), based on the last-modified date stored in the file system or FTP server.

Note: For the dynamic pages (like aspx and PHP) it doesn't happen, in other words the dynamic page's last-modified header will not be sent.

4. The components of the page should optimally be in order: The Page component should be in order so the page will can load faster. First of all the page content should load with CSS and JavaScript because by using CSS and JavaScript the page will initially display. The content should be text on your webpage not in images format. Always remember that the dynamic feature, if required, then the first your page should be loaded and then only enabled or load your dynamically feature after the page has loaded.

5. Use valid markup: For the valid markup use modern CSS. It can also reduce the need of Images because we can use CSS3 to design our images mostly logos and colorful text. The advantages of valid markup is browsers will have no need to do error-correction when parsing the HTML.

6. Chunk your contents: Some web-developers and web-designers use nested tables to design them website layout. To design the webpages layout don't use tables because this is a legacy method and uses a <DIV> to design your webpage layout and you can also use a CSS3 Multi-column Layout or CSS3 Flexible Box Layout. The table is still considered valid markup, but should be used to display tabular data and one of the most things instead of displaying nested tables (such as in the following).

  1. <TABLE>
  2. <TABLE>
  3. <TABLE>
  4. <TABLE>
  5. ...
  6. </TABLE>
  7. </TABLE>
  8. </TABLE>
  9. </TABLE>

Display a non-nested table or div (such as in the following):

  1. <TABLE>...</TABLE>
  2. <TABLE>...</TABLE>
  3. <TABLE>...</TABLE>
  4. <TABLE>...</TABLE>
  5. <TABLE>...</TABLE>

7. Specify the size and position for images and tables: If you specify the size and position of the images and tables then the browser can immediately determine the height and width of the images and tables so it will be able to display a web page without the necessity to reflow the content. This not only speeds the display of the page but prevents annoying changes in a page's layout when the page finishes loading. So for this reason you should specify the size and position of the images.

8. Use async and defer, if possible: Make the JavaScript scripts such that they are compatible with both the async and the defer and use mostly use async whenever possible. It should be, when you have multiple <script> tags in your webpage. With the async, the page stops rendering while JavaScript is still loading otherwise what will happen is that the browser will not render anything that is after the script tags that does not have these attributes. And for the async you can use an AJAX call in your webpage so the page will stop rendering and JavaScript will be loaded automatically or asynchronously.

Conclusion

Some of these tips can speed up your website load time. You can optimize your webpages. You can reduce the page weight, cache your page and you will use valid markup. So your productivity and the user will not be irritated and the user will not wait for your webpage and visitors and customers will grow on your site and the user will have a better experience.