All Products
Search
Document Center

Dynamic Content Delivery Network:Configure range origin fetch

Last Updated:Sep 06, 2023

If a request redirected from a point of presence (POP) to the origin server carries the Range header, the origin server returns the content 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

Range 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 range origin fetch is enabled, requests for resources that have expired or are not cached on POPs are redirected to the origin server with the Range header retained. Then, DCDN retrieves the specified chunk of file from the origin server and caches the file chunk on POPs.

The following figure shows how range origin fetch works.Range回源

Usage notes

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.

Procedure

  1. Log on to the DCDN 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 Configure in the Actions column.
  4. In the left-side navigation pane of the domain name, click Origin Fetch.
  5. On the Origin Fetch tab, find the Range Origin Fetch section.

  6. Turn on or off Range Origin Fetch.

    Range Origin Fetch

    Description

    Example

    On

    If you want to access a specified portion of a resource file, turn on Range Origin Fetch to accelerate content delivery. After you turn on Range Origin Fetch, POPs redirect requests with the Range header retained to the origin server. The origin server returns a specific range of bytes of the file based on the Ranger header. Then, DCDN returns the content to the client.

    If a client sends a request that contains range:0-100 to the origin server, the request that is received by the origin server from the POPs also contains range:0-100. Based on the Range header, the origin server returns a file that contains 101 bytes in the range of 0 to 100 to DCDN. Then, DCDN returns the file to the client.

    Off

    If you want to access the whole resource file, turn off Range Origin Fetch. After you turn off Range Origin Fetch, POPs redirect requests that do not contain the Range header to the origin server. The origin server returns the entire file to POPs. Then, POPs return the requested file to the client. After the client receives the requested file, the client automatically terminates the HTTP connection to POPs. As a result, the file that is returned from the origin server is not cached on POPs. This decreases the cache hit ratio and increases the origin traffic.

    If a client sends a request that contains range:0-100 to the origin server, the request that is received by the origin server from POPs does not contain the Range header. Then, the origin server returns the entire file to POPs, and POPs return 101 bytes to the client. After the client receives the requested file, the client disconnects from POPs. As a result, the file that is returned from the origin server is not cached on POPs.