When the origin returns a 301 or 302 redirect, ESA POPs follow the redirect to fetch the target resource directly, reducing round trips and accelerating delivery.
Prerequisites
Your origin server uses 301 or 302 redirects.
About 301 and 302 redirects
HTTP 301 indicates a permanent redirect and HTTP 302 indicates a temporary redirect. Both include a Location header that points to the new resource URL. The client follows this header to access the resource at the new address.
How 301/302 redirect works
When an ESA POP receives a 301 or 302 response from the origin, it follows the Location header to fetch the resource directly instead of returning the redirect to the user.
Process flow:
A user requests
http://example.com/examplefile.txtfrom an ESA POP.The file is not cached on the ESA POP, so the POP requests it from the origin.
The origin returns a 301 or 302 response to the ESA POP with the Location header pointing to
http://www.example.org/examplefile.txt.The ESA POP follows the Location header and requests
http://www.example.org/examplefile.txt.The ESA POP retrieves and caches the resource.
The ESA POP serves the resource to the user.
Subsequent requests for http://example.com/examplefile.txt hit the cache on the ESA POP and are served directly.
Supported header formats
The Location header in the 301 or 302 response from the origin to the ESA POP supports these formats:
Standard domain name format:
http://www.example.net/index.htmlIPv4 address format:
http://10.10.10.10/index.html
The Host header remains unchanged during a redirect follow request regardless of whether original request headers are retained.
Set up redirect rules
In the ESA console, select Websites, and in the Website column, click the target site.
In the left navigation pane, choose .
Click Create Rule and enter a Rule Name.
Under If requests match..., set the match conditions for incoming requests. To learn more about creating a rule expression, see Composition of a rule expression.
In the 301/302 Redirect Follow section, click Configure beside the feature. Turn on Status, and then configure the following parameters for 301/302 origin follow redirects:
Maximum Redirects: Maximum times an ESA POP follows Location headers per request.
If exceeded, the 301/302 response is returned to the user. Valid values: 1 to 5. Default: 2.
NoteThis setting also limits total origin access per request.
Origin access limit = maximum redirects + 1.
Default: 3. Valid values: 2 to 6.
Original Request Parameters: Whether to retain the original request parameters when following the redirect to the origin.
Original Request Header: Whether to retain the original request headers when following the redirect to the origin.
Target Host: Controls the Host header value when the ESA POP follows a redirect. Rules:
If a domain is configured here, it overrides the Host header regardless of the Location header format.
If the Location header contains a domain name, the Host header value is the same as that domain name.
If the Location header contains an IP address, the Host header value from the original request is preserved.
Click OK.
Related documentation
Rule-related features vary in effective priority, reentrancy, and effective granularity. For details, see Properties of Rule-Related Features.