The existence of CDN accelerates the access speed of users and enables users to obtain better access experience without increasing the network speed. When shopping, it can display pictures of products faster; When watching a movie, you can browse by dragging and dropping. If data resources are packages, the user’s bandwidth is like a truck with a maximum capacity limit. Before CDN acceleration, trucks can only drive on ordinary roads, forced by various traffic lights and traffic jams. After the adoption of CDN, trucks are like VIP privileges, driving on the highway, can be more smooth and efficient.

Have you ever thought about how to make the truck go faster and the goods go faster?

Smart compression – Packing goods into smaller sizes

In HTTP access, resource compression usually requires the cooperation of both the client and the server. For example, when a user initiates a request, the accept-Encoding header field will be carried to indicate the compression algorithm supported by the client. On the other end, the server needs to identify the header field, select a supported algorithm to compress the resource, and return the content-Encoding header field to the user, indicating that the server has used an algorithm to compress the resource.

For example, when accessing Upyun.com using Chrome, the accept-encoding header is carried in the request header:

In the corresponding response header, Content-Encoding: gzip indicates the compression algorithm used by the server, and the Vary header field is used for Content negotiation.

The intelligent compression of Youpaiyun includes Gzip and Brotli two mainstream compression algorithms, supporting 1-5 compression levels. Even if the source site does not support Gzip and Brotli algorithms, it can respond to the corresponding content and reduce the CPU consumption during source site compression.

After the smart compression function is enabled, the file size changes can be directly seen during access.

302 Dispatch – Choose a more suitable route

DNS resolution errors cause a high delay in user access. For example, when users could directly access nodes in Shanghai, they return to Shanghai after a long loop from Shandong, which increases the access time and affects the access experience.

For example, when a user visits zhuhai, guangdong for the first time (node 113.106.98.34 in figure 1,2), the edge node resolves the node that the user should visit (node 58.222.18.2 in figure 1,2) according to the accurate internal DNS, and places it in the Location header field. After receiving the 302 response, the client accesses the Location in the Location to accelerate.

Note that the 302 redirect consumes a certain amount of resources. Therefore, enabling 302 scheduling can achieve good results only when the user client supports 302 adjustment and resources are large files.

The enabling method is very simple, just find the column of “Performance Optimization” in youpai Cloud console, select its “HTTP 302 scheduling” function, and enable it.

Page compression – squeezes air out of cargo

If the shipment is a fluffy quilt (AN HTML file stuffed with comments and repeated whitespace) that, when page compression is turned on, appears in a vacuum compression bag as it travels through the CDN, HTML, javascript and CSS comments embedded in HTML documents, and repeated whitespace are removed, reducing the amount of redundant content on the page, while the quilt content remains the same, just thinner and smaller, making it much more efficient to transfer.

Video drag-and-pull is awesome

Open the video pull function of the console, and you can control the video playback control bar with MP4 and FLV format files containing key frames. FLV supports dragging by byte, while MP4 drags by time. By extending this, you simply have the player make a request in a convention format, such as example.com/video/test…. . In this way, the video can be played directly from the 20s position and end at the 30s position. Customers in the receipt of including a moment to open, see is the wonderful content prepared by the shipper.

On the CDN highway, there are many excellent schemes prepared by network architects, such as WebP adaptive function that can significantly reduce the volume of pictures, narrowband HD function that can optimize the volume of videos, etc., so that large trucks can run faster and more stable on the CDN highway.

Learn more:

Cloud Distribution – Fast and stable content delivery Network CDN