Overview
When EdgeOne retrieves resources from the origin, if the origin successfully responds with the resources, EdgeOne will respond to the client request and cache it within EdgeOne for direct response next time. If the origin responds with abnormal status codes such as 4xx or 5xx, and EdgeOne cannot obtain the resources, the next request will still trigger a return to the origin, which may put significant pressure on the origin. By configuring the status code cache TTL, EdgeOne can directly respond with the abnormal status code within the cache time, rather than triggering a return to the origin for all requests. This can alleviate the pressure on the origin and improve response speed.
The following status codes can currently be configured:
4xx:400、401、403、404、405、407、414。
5xx:500、501、502、503、504、509、514。
Note:
By default, EdgeOne caches the 404 status code for 10 seconds.
Instructions
Scenario 1: Configuring Status Code Cache TTL for All Domain Names of a Site
To configure the status code cache TTL for all domain names used to access a site, or as a fallback configuration at the site level, refer to the following steps:
1. Log in to the Edge Security Acceleration Platform Console. In the left-hand menu, click on Site List. Within the site list, click on the site that needs to be configured.
2. On the site details page, click Rule Engine.
3. On the rule engine management page, click Create rule to enter the new rule editing page. On the rule editing page, select the match type as 'All' (any site request).
4. Click on Operation, in the pop-up operation list, select Status Code Cache, and configure the corresponding cache status code and cache time.

5. Click "Save and Publish" to complete the configuration of this rule.
Scenario 2: Configuring Status Code Cache TTL for Specific Domains, Paths, or File Extensions
If you need to configure different status code cache TTLs for different domain names, paths, or file extensions, for example, configuring the status code cache TTL for the
www.example.com domain under the example.com site, you can refer to the following steps:1. Log in to the Edge Security Acceleration Platform Console. In the left-hand menu, click on Site List. Within the site list, click on the site that needs to be configured.
2. On the site details page, click Rule Engine.
3. On the rule engine management page, click Create rule to access the new rule editing page. On the rule editing page, select Host as the matching type and configure it as
www.example.com.4. Click Operation, in the pop-up operation list, select Status Code Cache and configure the corresponding cache status code and cache time.

5. Click Save and publish to complete the rule configuration.