Caching Resources
With the Caching Resources policy it is possible to cache requests based on their URL path, HTTP method and HTTP status code. This allows reducing overall traffic to the backend API.
If you want to cache POST requests, you have to enable stateful request payload inspection in the API Settings.
Configuration Options
Basic Configuration
Option | Description | Allowed Values | Default | |
---|---|---|---|---|
TTL | Specify a duration in seconds for how long the resources are cached (time-to-live). | any integer | - | |
Path | Enter a regular expression that will be used to identify the REST resource to cache. This applies to the resource path from the API endpoint on. Regular expressions must be written in Java syntax. | a valid regular expression | - | |
Method | Specify a HTTP method to apply the path pattern to. If you want to cache POST requests, you have to enable stateful request payload inspection in the API Settings. | * | Cache all allowed methods (see below). | * |
GET | Cache GET requests only. | |||
POST | Cache POST requests only. | |||
HEAD | Cache HEAD requests only. | |||
Status Code | Specify a status code that will be used to identify the REST resource to cache. | a three-digit integer | - | |
Click Add to create more rows in the table. Click Delete to remove selected rows. |
Related Pages: