Range
is one of the HTTP request headers, which is used to get files in the specified range. You can use a range request to request only partial file content from the server. For example, if a request carries the HTTP header range: bytes=0-999
, the first 1,000 bytes of the file will be returned to the user.
In CDN, after Range GETs is enabled, origin-pull requests will carry the Range
header by default. If the partial file requested by a user is not cached on the node or its cache has expired, CDN will perform Range GETs to pull and cache the requested partial file to the node and return it to the user. After Range GETs is disabled, if the user request doesn't carry the Range
header, CDN will still pull the entire file during origin-pull.
For large files such as APK, audio, and video files, you can use range requests to effectively improve the delivery efficiency of large files, shorten the response time, and reduce the pressure on the origin.Item | Description |
Type | You can select All Files, File Extension, File Directory, or Full Path: All Files: This Range GETs rule applies to all files. It is the default rule and cannot be deleted. File Extension: This Range GETs rule applies to the specified file extensions. File Directory: This Range GETs rule applies to the specified file directories. Full Path: This Range GETs rule applies to the specified file paths. |
Content | Enter the content based on the selected file type: If Type is File Extension, you can enter one or multiple file extensions separated by ";". If Type is File Directory, you can enter one or multiple file directories separated by ";", and the entered content cannot end with "/", such as /test;/a/b/c .If Type is Full Path, you can enter one or multiple full file paths separated by ";", such as /index.html;/test/\*.jpg . The file path supports the * wildcard. |
Range GETs | Range GETs can be enabled or disabled. Enable: If Range GETs is enabled, range requests are used for origin-pull requests. After Range GETs is enabled, if the user request does not carry the Range header and the requested files are larger than 4 MB in size, the CDN node splits the origin-pull request into several sub-requests for origin-pull based on a shard size of 1 MB. If the requested files are smaller than 4 MB in size, the CDN node pulls complete files from the origin server. If the user request carries the Range header, the CDN node uses the Range header for origin-pull.Disable: If Range GETs is disabled, range requests are not used for origin-pull requests. |
cloud.tencent.com
as follows:
http://cloud.tencent.com/test.apk
. After the node receives the request and finds that the cached file test.apk
has already expired, the node initiates an origin-pull request. Since Range GETs is enabled for all files in the current rule, the node uses a range request to obtain and cache the resource in shards. If user B also makes a range request for the same file to the same node and the shards that are stored on the node match the specified byte segments in the range request, the resource is directly returned to user B even though the shards are not completely obtained.cloud.tencent.com
as follows:
http://cloud.tencent.com/test.apk
resource, as the bottom rule has a higher priority than the top rule, Range GETs will be used for the request if the node resource is not hit or the cached resource has expired. If user B makes a request for the http://cloud.tencent.com/test.jpg
resource, as it only matches the rule for all files, Range GETs won't be used when origin-pull is performed for the request.
Was this page helpful?