All Products
Search
Document Center

CDN:Range origin fetch

Last Updated:Oct 17, 2024

If a request that is redirected from a POP to the origin server includes the Range header, the origin server returns the content that is specified by the Range header to the POP. This process is called range origin fetch. Range origin fetch accelerates content delivery, 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 POPs are redirected to the origin server with the Range header retained. Then, Alibaba Cloud CDN retrieves the specified file chunk from the origin server and caches the file chunk on POPs.

The following figure shows how the range origin fetch feature 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, resources cannot be cached on POPs after range origin fetch is enabled.

  • The range origin fetch feature is optional and is disabled 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.

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).

    Parameter

    Description

    Example

    Range Origin Fetch

    Do Not Enable Range Origin Fetch

    This is the default option. 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:0-100 to a POP. The POP redirects the request to the origin server without the Range header. The origin server returns the entire file to the POP. If the total size of the file is 10 MB, the origin server returns 10 MB of file data to the POP. The POP caches the received file and returns the chunk that is specified by range:0-100 to the client.

    Match Client

    If you choose Match Client, POPs redirect requests with the Range header retained to the origin server. For the first request for a resource that is redirected to the origin server, Alibaba Cloud CDN rounds up the value of the Range header to the nearest integer. For subsequent requests for the resource, Alibaba Cloud CDN sets the value of the Range header to 512 KB.

    For example, a client requests content that is 600 KB in size. The POP retrieves content that is 1,024 KB in size from the origin server for the first request and retrieves content that is 512 KB in size for subsequent requests.

    A client sends a request that contains range:0-100 to a POP. The POP requests a file chunk that is 512 KB in size from the origin server. The origin server returns the file chunk. Then, the POP caches the file chunk and returns it to the client.

    Enable Range Origin Fetch (Recommended for Large File Delivery)

    If you choose Enable Range Origin Fetch (Recommended for Large File Delivery), POPs redirect the requests of a client to the origin server with the Range header retained, regardless of whether the requests contain the Range header. Every range request pulls content that is 512 KB in size from the origin server.

    None.

    Rule Condition

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

    • Do not use conditions

    • Select the configured rule conditions in Rules Engine. For more information, see Rules engine.

  7. Click OK.