All Products
Search
Document Center

:Automatically disconnect large files by Alibaba Cloud Content Delivery Network request

更新時間:Jun 03, 2021

Problem description

Accessing a large file through Alibaba Cloud Content Delivery Network will automatically disconnect during the request process.

Troubleshooting

Run the following command to analyze the returned result:

curl -voa http://[$Address]

Description :[$Address]: refers to the address of the Alibaba Cloud Content Delivery Network.

The system display is similar to the following, and "transfer closed with 158206570 bytes remaining to read" error message is found.

According to the error message, this file is larger than 100MB. The following information can be obtained from the Response Headers analysis:

  • X-Cache: MISS TCP_MISS dirn:-2:-2 indicates that this is a MISS request and is back to the source.
  • X-Swift-CacheTime: 0 indicates that this request cannot be cached on the Alibaba Cloud Content Delivery Network and needs to be returned to the source every time.
  • Cache-Control: public, max-age=0 indicates that the source station responded to the max-age=0 here, which is the reason why the Alibaba Cloud Content Delivery Network cannot be cached.

Causes

This is a limitation at the product level. For files exceeding 100MB, if the source station responds to the non-caching policy such as Cache-Control as max-age=0 and no-cache, the Alibaba Cloud Content Delivery Network cannot be cached, and such requests will be disconnected by the Alibaba Cloud Content Delivery Network Swift cache component. This is mainly because if large file requests do not perform caching, they need to be returned to the source every time, which is equivalent to Alibaba Cloud Content Delivery Network not having an acceleration effect and affecting the Alibaba Cloud Content Delivery Network back-to-source bandwidth and the performance of the source station.

Solutions

The source station deletes Cache-Control headers that are not cached, and supports Alibaba Cloud Content Delivery Network such files can be cached. At the same time, for large files, if the source station supports Range, it is recommended to turn on the Range back-to-source function at the Alibaba Cloud Content Delivery Network level.

Application scope

  • CDN
  • DCDN