Feature Overview
When points of presence (POPs) retrieve resources from the origin server, the origin server returns HTTP status codes to the POPs. You can create cache rules for storing HTTP status codes by POPs. When clients request the same resource, the POPs return the status code instead of redirecting requests to the origin server. This reduces loads on the origin server. When the caching time of the status code on the edge node expires, requests that trigger the code are redirected to the origin server.
TTL values for status codes are used to control caching behaviors on POPs when an origin server returns status codes such as 4xx and 5xx.
Normally, if a POP retrieves the requested resource from the origin server, status code 2xx is returned and the POP processes the retrieved resource as described in configured cache rule and priorities of cache rules. If the origin server cannot quickly respond to requests by returning HTTP status codes such as 4xx and 5xx status codes, and you do not want the origin server to respond to all requests, you can specify a TTL for HTTP status codes. Then, the POPs can directly return HTTP status codes to requests. This way, loads on the origin server can be alleviated.
Typical Scenario
A file is removed from the origin server. Clients attempt to access the file, which is not cached on POPs. Then all requests for the file are redirected to the origin server. The origin server returns HTTP status code 4xx to each request. If you create a cache rule for HTTP status code 4xx, HTTP status code 4xx returned for the first request is cached on POPs. POPs directly return HTTP status code 4xx to subsequent requests instead of forwarding them to the origin server.
Before You Begin
You have added a service domain name. If you have not added it, see Adding a Service Domain Name.
Procedure
1. Log in to AOne, select Acceleration Management > CDN Acceleration Configuration, and select the domain name to be configured in the domain name list.
2. On the domain name configuration details page, select Cache Configuration and click Edit Configuration.
3. Select TTL of Status Code and click Add Rule.
4. Enter one or more error status codes, and separate them with commas (,). Select a unit for Expire In, such as seconds, minutes, hours, or days, and fill in the corresponding expiration time.
5. Click OK.