First, browser access optimization

1.1 The main means to reduce HTTP requests is to merge CSS, JS and images. You can merge the JS and CSS required by a browser into one file, and multiple images can be combined into one. You can set hyperlinks corresponding to different images through CSS offset response.

1.2 Static Resource Browser Cache You can Cache static resources such as CSS, JS, and ICONS to the browser. You can set cache-Control and Expires attributes in the HTTP header to rename and reference the original file when it needs to be updated.

1.3 Enabling compression for HTML, CSS, and JS Files To enable Gzip compression, set the Accept-Encoding attribute in the HTTP header to Gzip and Deflate, and enable the Gzip module on the server to reduce the amount of data transmitted.

The browser will load the entire CSS before rendering the entire page, so it is best to put the CSS at the top and let the browser download the CSS as soon as possible. Browsers execute JS as soon as they load it and can block the entire page, so it’s best to keep JS at the bottom unless you need it for page parsing.

1.5 Reducing Cookie Transmission Cookies are included in each request and response. Too large cookies will affect data transmission and minimize the amount of data transmitted in cookies. In addition, static resources can be accessed using independent domain names to avoid sending cookies when requesting static resources, which is meaningless.

Second, CDN acceleration

Content Distribute NetWork (CDN) is still a cache in essence, which stores requested resources in the nearest place to users so that users can access resources at a faster speed. Static resources such as pictures, files, CSS, JS, and static web pages can be cached in the CDN service provided by third-party carriers, which greatly improves user access speed.

Reverse proxy

The reverse proxy server forwards a user request to a Web server cluster to implement load balancing and improve concurrent performance. The proxy server can also be configured with caching to expedite Web requests.