The range origin fetch feature enables Dynamic Route for CDN (DCDN) to retrieve resources from the origin server based on HTTP range requests. The origin server then returns partial content within the specified range. This accelerates delivery of large files. This feature reduces the back-to-origin data usage and shortens the resource response time. This topic describes how to configure range origin fetch.

Background information

Make sure that the origin server supports HTTP range requests. If the HTTP request header contains the range field, the origin server can return 206 Partial Content.

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 on the details page of the specified domain, click Origin Fetch.
  5. On the Origin Fetch tab, find Range Origin Fetch.
  6. Turn on or off Range Origin Fetch.
    Range origin fetch
    Range Origin Fetch Description Example
    On If you need to access the specified part of a resource file, turn on Range Origin Fetch to improve resource response efficiency. After Range Origin Fetch is turned on, when DCDN receives a byte-range request and cannot return the requested resources from the cache, DCDN forwards the request that contains the range field to the origin server. When the origin server receives the request, the origin server returns a file that has the specified number of bytes based on the range field. Then, DCDN returns the file to the client. If a client sends a request that contains range:0-100 to DCDN, the request that is received by the origin server from DCDN contains range:0-100. Based on the range field, the origin server returns a file that has 101 bytes in the range of 0 to 100 to DCDN. Then, DCDN returns the file to the client.
    Off If you need to access all the content of the resource file, turn off Range Origin Fetch. After Range Origin Fetch is turned off, when DCDN receives a byte-range request and cannot return the requested resources from the cache, DCDN forwards the request that does not contain the range field to the origin server. When the origin server receives the request, the origin server returns the entire file to DCDN. Then, DCDN returns the requested range to the client. After the client receives the requested range, the client automatically closes the HTTP connection to DCDN. As a result, the file returned from the origin server is not cached on DCDN. This decreases the cache hit ratio and increases the back-to-origin data usage. If a client sends a request that contains range: 0-100 to DCDN, the request that is received by the origin server from DCDN does not contain the range field. Then, the origin server returns the entire file to DCDN, and DCDN returns 101 bytes to the client based on the range field. When the client receives the requested range, the client is disconnected from DCDN. As a result, the file that is returned from the origin server is not cached on DCDN.