All Products
Search
Document Center

CDN:Range origin fetch

Last Updated:Jun 11, 2025

If a request that is redirected from a CDN point of presence (POP) to the origin server includes the Range header, the origin server returns the content that is specified by the Range header to the CDN POP. This process is called range origin fetch. Range origin fetch accelerates file distribution, increases cache hit ratios, reduces origin traffic and loads on origin servers, and speeds up site response.

Background information

The Range header is an HTTP header that specifies the part of content to be retrieved. For example, Range: bytes=0-100 specifies that the origin server is required to return the first 101 bytes in the requested file.

After you enable the range origin fetch feature, requests for resources that have expired or are not cached on CDN POPs are redirected to the origin server with the Range header retained. Then, CDN retrieves the specified file chunk from the origin server and caches the file chunk on CDN POPs.

The following figure shows how range origin fetch works.

image

Usage notes

When you enable the range origin fetch feature, take note of the following rules:

  • Make sure that the origin server supports HTTP range requests, and the origin server can respond to requests with the HTTP 206 status code (partial content message). If the origin server does not support HTTP range requests, an exception may occur when resources cannot be cached on POPs or client requests fail.

  • The range origin fetch feature is optional and is disabled in the CDN console by default.

  • The Multipart Ranges feature is disabled by default and is not enabled after you enable the range origin fetch feature. To enable the Multipart Ranges feature, submit a ticket.

  • After the range origin fetch feature is enabled, the queries per second (QPS) of origin fetch increase. If the rate limiting feature is enabled on the origin server, requests sent to the origin server could be throttled. To prevent this issue, you can call the DescribeL2VipsByDomain operation to query the IP addresses of origin fetch POPs of CDN and add these IP addresses to the IP address whitelist of the origin server.

Procedure

  1. Log on to the Alibaba Cloud CDN console.

  2. In the left-side navigation pane, click Domain Names.

  3. On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.

  4. In the left-side navigation tree of the domain name, click Video.

  5. In the Range Origin Fetch section, click Modify.

  6. Set the Range Origin Fetch parameter to Do Not Enable Range Origin Fetch, Match Client, or Enable Range Origin Fetch (Recommended for Large File Delivery).

    If you select Match Client or Enable Range Origin Fetch (Recommended for Large File Delivery), you can set the Shard Size parameter. Default value: 512 KB.

    Parameter

    Description

    Example

    Range Origin Fetch

    Do Not Enable Range Origin Fetch

    This is the default option. CDN POPs retrieve the entire file from the origin server, regardless of whether the request carries the Range header. In this case, the file distribution efficiency is lower than expected in large file distribution scenarios.

    A client sends a request that contains Range: bytes=0-100 to a CDN POP. The CDN POP redirects the request to the origin server without the Range header. The origin server returns the entire file to the CDN POP. The POP caches the received file and returns the chunk that is specified by Range: bytes=0-100 to the client.

    Match Client

    After you select Match Client, a client sends a Range request to a CDN POP. The CDN POP forwards the request to the origin server. For the first request for a resource that is redirected to the origin server, CDN rounds up the value of the Range header to the nearest integer, which is an integer multiple of the shard size in this case. For subsequent requests for the same resource, you can set the size of the Range header to the value of the Shard Size parameter.

    If the Shard Size parameter is set to 512 KB, a client sends a request that contains Range:bytes=0-614399 (600 KB) to a CDN POP. The CDN POP retrieves content that is 1,024 KB (the nearest integer rounded up from 600 KB) in size from the origin server for the first request and retrieves content that is 512 KB in size for subsequent requests.

    Enable Range Origin Fetch (Recommended for Large File Delivery)

    After you select Enable Range Origin Fetch (Recommended for Large File Delivery), CDN POPs redirect client requests to the origin server with the Range header included, regardless of whether the requests contain the Range header. Every range request pulls content in the configured size, which is the value of the Shard Size parameter, from the origin server.

    N/A

    Shard Size

    • 512 KB

    • 1 MB

    • 2 MB

    • 4 MB

    If you set the Range Origin Fetch parameter to Match Client or Enable Range Origin Fetch (Recommended for Large File Delivery), you can set the Shard Size parameter. Default value: 512 KB.

    1 MB

    Rule Condition

    • Do not use conditions

    • Select the configured rule conditions in Rules engine.

    Rule conditions can identify parameters in a request to determine whether a configuration applies to the request.

    Do not use conditions

  7. Click OK.