Generally speaking, visitors do not like to spend too much time waiting for web pages to be opened. The longer we wait, the greater the likelihood that the users will close the page directly, causing significant traffic losses! Second, the ranking of keywords is also related to the speed with which web pages are opened, mainly because of the good user experience of the search engine, which ranks better than other websites。
It is therefore necessary for station chiefs to keep increasing the speed at which business web pages are opened in china, a process that does not require much cost-management input, but rather a little more attention to the skills that we normally need, so that you can share 20 ways to speed up data access to your website and reduce the load time。
1. Reduced number of http requests on page
More directly, it is understood to reduce the number of calls to other pages and documents。
(1) when we use the css format controls, we often use the backstage to load many graphic files and each background image produces at least one http request. Usually, we use the background to load a lot of background images to make the page live. To improve this situation, a useful background-position attribute of css can be used to load background images. The ma hae-sang proposal would require a combination of many pictures loaded frequently. When loaded, the http request to load this part of the picture can be reduced to 1:
(2) this method is also more common for image maps but is limited to the same area。
(3) inline images, a study that is rarely visible, is useful for a very simple image message。
2. Adding expired or cache headers
For photographs and js script files frequently visited by the same user, you can set a cache time in apache or nginx, e. G. A 24-hour expiry time, so that the page can be accessed again after the user has visited the page, without re-downloading the same photo set or js, reducing http requests, significantly increasing user access speed and reducing server loads。
3. Server open gzip compression
This is an issue that is more analytically understood to mean that the content that an enterprise needs to transmit can be condensed and then transmitted to the client for decompression, so that the amount of data transmitted on the network can be significantly reduced。
Normally, apache and nginx on the server can either directly open this setting, set the transfer header directly from the point of view of the code, add a gzip setting, or set directly from the load balancing device, but it needs to be noted that this setting will slightly increase the server burden。

4. Formatting definitions for css at the top of the file
This configuration would be less beneficial if the user-end was a slow network or a larger web content, and would be able to maintain format information while the web pages were slowly appearing, without compromising the beauty of the page。
5. JavasCript script at the end of the file
Many javasCript scripts are inefficient or some third-party domain scripts have unexpectedly failed to load, and if they are placed at the top of the page, they may cause our own website content to be slowed down or even not properly loaded. As a result, these scripts are generally placed at the end of the web file and must be loaded in front of the script using the so-called “post load” mode, and the loaded home page is completed to prevent them from affecting the loading speed of the home page。
6. Avoiding the use of css scripts by enterprisesI'm sorry
Sometimes, in order to hope for dynamic changes in the csss parameter, it can be achieved using the csss expression, but this exceeds the loss, which significantly increases the user-end browser burden and is therefore not recommended, and if changes are needed you can use javasCript's foot was supposed to make it happen。
7; css; javasCript to call from outside china
If css and js content are large, try not to put them on the same page. It would be better to load them from the outside, because the browser will cache css and js files。
8. Multiple files and pictures are loaded on the web page using multiple domain names。
It will be recalled that during the web posting process, the number of requests for http in parallel with a domain name reached a maximum of two at the same time. If a web design requires more than two (usually far from all) documents to be loaded, it is advisable to speed up access to china by means of enterprise web-page data, by distributing documents mainly to multiple domain names, such as the 19th floor, where js file management uses student-owned domain names, and the number of 100 degrees of photo servers is said to be over 20。
9. Reduction of match ifRame's use. If not necessary, try not to use it
IfRame is usually used to load content of different domain names because ifThe faster loading of rame content may also affect the loading speed of the main web page and, if possible, capture the load to the local direct embedded. If you really need..Rame loads, please use the afterload method。
11. Avoidance of duplicate script calls

Developing good development and maintenance habits and avoiding, to the extent possible, any repetition of script calls not only makes web code swollen but also delays the opening of web pages by too many scripts。
12. Optimizing photo files
Optimizing image files and reducing their size, especially thumbnails, must generate thumbnails based on size and then call, rather than using reesize methods on the web page, although the images look interesting, but they do not reduce loading. I've seen people upload thumbnails on a 10-byte page。
Normal pictures and icons are also kept as condensed as much as possible, which can be achieved by preserving web images and reducing the number of colours。
Etag is called entity tag, which means that the entity labels it, by name, is an important label for an enterprise's information entity, which is part of the http agreement, that is, that all of our web servers should (and indeed) support china's social identity。
Its role is to identify the " version " of the resource with a special string, which means that the client (browser) can use its own cache version when the client (browser) can request it, if the resource is consistent with etag。
14, ajax cache call
It can be used with reference to the discuz forum code, which is used for a large number of ajax calls in cache calls, usually with additional feature parameters。
15. Reasonable choice to use flush
After users send out browsing requests, servers usually require 200-500 ms to process these requests. During this period, the user browser is waiting. If the user wants to reduce the waiting time, you can use refreshing to push the content ready to the user in the right place, which is easy to achieve in php, for example:
Use the get method as much as possible in ajax calls

When the xmlttprequest is actually used, two http requests will occur if the post method is used, and if the gt method is used, only one http request will occur. If you switch to get, http requests will be reduced by 50%!
17. Minimize dcom elements
This is well understood in order to minimize the amount of elements in the enterprise web page, which is a very heavy redundancy that we cannot replace entirely。
18. Avoiding 301 and 302 reorientation
301 is a permanent jump, 302 is a temporary jump, usually 301 jumps, few people use 302,301 jumps to shift the weight of 100 degrees from one site to another, 100 degrees 302 jumps are still on the original site, only temporarily jumps, of course, and the general use of these jumps takes some time to buffer, and if 302 jumps take too long, 100 degrees may be judged to be cheating and k stops。
Use of page breaks
When the page content is huge to a certain level, the body pattern that allows the page break to be accepted reveals that perhaps the type of page-turning that is loaded behind the page of taobao, such as allowing maximum reduction in the speed of single page openings, increases the speed of page openings。
20. Use content delivery networks to speed up
There are now a lot of companies in china that are doing cdn-accelerated development, simply spreading your pictures and videos to places where the cdn network technology can reach, allowing users to download these policy documents as soon as they access the data, thus enabling them to achieve the enterprise network’s goal of speeding up, while reducing the load on one of your own websites。
The speed of web pages is one of the important factors in improving the user experience of the site. Once the website is good and opened too slowly, a large number of users are lost and even eliminated。
Increasing the speed of the website requires many aspects, and making it faster requires a variety of approaches, from server structures to a small icon, so one small factor should not be overlooked。




