With byte-range segments, Edge Security Acceleration (ESA) POPs include Range headers in back-to-origin requests so the origin server returns only the requested byte range to the ESA POP. This improves distribution efficiency, increases cache hit ratios, reduces back-to-origin traffic and the load on the origin server, and accelerates resource responses.
How it works
Range is an HTTP request header that specifies the byte range of content to retrieve. For example, Range: bytes=0-100 tells the origin server to return the first 101 bytes of the requested file.
When enabled, if ESA receives a request for a resource not cached or expired on the ESA POP, the ESA POP fetches only the required segment from the origin via a Range request and caches it on the ESA POP.
How byte-range segments work:
Prerequisites
Your origin server must support Range requests by accepting the Range header and responding with HTTP 206. If the origin does not support Range requests, enabling this feature prevents resources from being cached.
Usage notes
Range requests are not used during origin fetch for dynamic resources. A resource is dynamic if its extension is not in the default cache file list of the ESA POP, no explicit cache policy is configured for the resource on the ESA POP, and the cache status in the ESA POP's response is DYNAMIC.
Segment size affects cache hit ratio and download speed for uncached resources. Consider the following scenarios:
-
If ESA POPs and origin servers have low back-to-origin latency, use a smaller segment size to improve cache hit ratio and back-to-origin download rate.
-
If the origin fetch network performance between ESA POPs and origin servers is moderate, such as in cross-border or intercontinental scenarios with high latency, use a larger segment size. This may not achieve the optimal cache hit ratio but ensures a higher back-to-origin download rate.
-
Enabling Range requests increases origin-fetch QPS, which may trigger rate limits on the origin server. To prevent this, enable the origin protection feature for ESA and add ESA origin-fetch POP IP addresses to the allowlist on your origin server.
Procedure
-
In the ESA console, go to Site Management. In the Website column, click the name of the target site.
-
In the navigation pane on the left, choose .
-
Click Create Rule and specify the Rule Name.
-
In the If requests match... section, configure the matching conditions for client requests. For more information, see Structure of rule expressions.
-
In the Range Requests section, click Configure. Then choose one of the following options:
— Match Client (Default)— Disable
— Enable (Recommended If Large Files Requested)When you select Match Client (Default) or Enable (Recommended If Large Files Requested) , set the segment size to 512 KB, 1 MB, 2 MB, or 4 MB. Default: 512 KB.
Parameter Name
Options
Description
Example
Origin Mode
Match Client (Default)
The default option is Match Client (Default). When a client sends a Range request to an ESA POP, the POP performs a Range-based origin fetch. For the first request, the ESA POP rounds up the Range size to the nearest multiple of the shard size. Subsequent origin-fetch requests use the configured shard size.
For example, when the shard size is 512 KB, if a client sends a request containing
Range:bytes=0-614399(i.e., 600 KB) to an ESA POP and no cache file exists on the ESA POP, the first origin request retrieves data in 1024 KB shards (600 KB is rounded up to 1024 KB). For subsequent client requests for other uncached shards of this file, the ESA POP retrieves data from the origin server in 512 KB shards.Disable
If you enable Disable, regardless of whether a client sends a Range request to an ESA POP, the ESA POP fetches the entire file from the origin, which reduces efficiency for large files.
For example, if a client sends a request containing
Range:bytes=0-100to an ESA POP, the ESA POP does not pass the Range header to the origin. The origin responds to the ESA POP with the complete file (assuming the complete file is 10 MB, the origin server sends a 10 MB file to the ESA POP). The ESA POP caches the file and responds to the client with the content specified in therange:0-100request.Enable (Recommended If Large Files Requested)
Enable (Recommended If Large Files Requested)When enabled, ESA POPs always use Range requests for origin fetches, regardless of whether clients send Range requests. ESA POPs send all origin-fetch requests using the shard size configured in the ESA shard size parameter.
None
Shard Size
-
512 KB
-
1 MB
-
2 MB
-
4 MB
The segment size is configurable only when the mode is Match Client (Default) or Enable (Recommended If Large Files Requested). The default is 512 KB.
1 MB
-
-
Click OK .
Related documentation
Rule-related features vary in effective priority, reentrancy, and effective granularity. For details, see Properties of Rule-Related Features.