Range requests refer to origin requests that include the Range header. When an origin server receives a range request, it immediately serves the requested range from the cache if the Edge Security Acceleration (ESA) cache contains the requested range. Range requests enhance the efficiency of file distribution, improve cache hit ratios, boost resource response times, and reduce origin traffic.
How it works
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 of the requested file.
When ESA receives a Range request, it forwards the request to the origin if the requested range is not cached or has expired. ESA then caches the retrieved resource at its points of presence (POPs) for future requests.
The following figure shows how range requests work:
Before you begin
Make sure that the origin server supports HTTP range requests, and the origin server can respond to requests with HTTP status code 206 (Partial Content). If the origin server does not support HTTP range requests, resources cannot be cached on POPs.
If the requested resource is a dynamic resource whose file suffix is not included in the ESA's default cacheable file list, ESA does not set a cache policy for such type of resource, and its cache status in the response is
DYNAMIC
, this request will not be processed as a range request.
Range chunk size
The chunk size can affect overall resource hit rates and the download speed of uncached resources. Therefore, adjust it according to your needs.
When Range requests are enabled, you can set the chunk size to 512 KB, 1 MB, 2 MB, or 4 MB. The default is 512 KB. The following two scenarios illustrate the best practices:
With good network performance: If the origin fetch network between the ESA POP and the origin has low latency, it is recommended to use a smaller range chunk size. This helps ensure a higher download speed and improves cache hit rates.
With average network performance: If the origin fetch network has high latency (for example, in cross-border or long-distance downloads), a larger range chunk size is recommended. This may not provide optimal cache hit rates, but it will help improve download speeds.
Configure range requests
In the ESA console, choose Websites and click the name of the website you want to manage.
In the left-side navigation pane, choose .
Click Create Rule and enter a name in the Rule Name field.
In the If requests match... section, specify the characteristics of the requests that you want to match. Then, click Configure in the Range Requests section.
Select Match Client (Default), Disable, or Enable (Recommended If Large Files Requested).
Match Client (Default)
When ESA receives a Range request, it forwards the request to the origin. For the first request for a resource that is redirected to the origin server, ESA rounds up the value of the Range header to the nearest integer. For subsequent requests for the same resource, you can set the size of the Range header.
Example: A client sends a request that contains
range:0-100
to a POP. The POP then requests a file chunk in the configured size from the origin server. The origin server returns the file chunk. Then, the POP caches the file chunk while also serving the requested range to the client.Disable
POPs retrieve the entire file from the origin server regardless of whether the request carries the Range header. In such cases, the file distribution efficiency is lower than expected in large file distribution scenarios.
Example: 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. The POP caches the file while also serving the requested range specified byrange:0-100
to the client.Enable (Recommended If Large Files Requested)
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 from the origin server.
Click OK.