Status Code Cache Configuration

Last updated: 2024-12-31 17:37:35

Configuration Scenario

Under normal circumstances, when a CDN node successfully pulls the requested resource (2XX status code) from the origin server, it processes the resource according to the node cache validity configuration. If the origin server cannot quickly respond with a non-2XX status code and you do not want all requests to be passed back to the origin server, you can configure the cache validity time for status codes. This allows the CDN node to directly respond with non-2XX status codes, reducing the load on the origin server. Currently supported status codes are:
4XX: 400, 401, 403, 404, 405, 407, 414, 451
5XX: 500, 501, 502, 503, 504, 509, 514

Configuration Guide

View Configuration

Log in to the CDN Console, select Domain Management from the menu bar, click Management in the domain operation column, enter the domain configuration page, switch tabs to Cache Configuration, where you can find Status Code Cache. By default, there is a rule: "404 - Cache for 10 seconds":


Adding rules

You can add status code cache rules as needed, click Add Status Code Cache:

Configuration limitations:
Only one rule can be added for each status code, cannot be added repeatedly.
When the cache time is 0, it means do not cache.