Home > Web Front-end > HTML Tutorial > How to better reduce page loading time

How to better reduce page loading time

零下一度
Release: 2017-07-17 15:08:58
Original
2059 people have browsed it
  1. How to better reduce page loading time, 19 methods are provided below, for reference only, interested friends can take a look.

  2. 1. The number of repeated HTTP requests should be reduced as much as possible

(1) Reduce the number of calls to other pages and files.

 (2) Sprite diagram

2. Place the definition of css style in the header of the file

This setting is suitable for users with slow network or large web page content. The situation is more favorable, and the format information can be maintained while the web page is gradually rendered, without affecting the beauty of the web page.

3. Put Javascript script at the end of the file

4. Compress Javascript and CSS code

5. Use CDN (Content Delivery Network) network acceleration

There are many companies doing CDN acceleration business in China. To put it simply, it is to spread your pictures and videos to places that the CDN network can reach, so that users can download these files nearby when they visit, thereby achieving the purpose of speeding up the network. Doing this , while reducing the load on your own website.

6. Enable gzip compression function on the server
After compressing the files to be transferred and then transferring them to the client and then decompressing them, the amount of data transmitted over the network will be greatly reduced. Apache and Nginx on the server can be enabled directly. You can also use code to directly set the transmission file header and add gzip settings. You can also set it directly from the load balancing device. However, it should be noted that this setting will slightly increase the load on the server. Websites whose server performance is not very good should be carefully considered.

7. Ajax uses cache calling
Ajax calls all use cache calling, and are generally implemented using additional feature parameters. Pay attention to

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template