References
Cache condition settings
json:http_cache_ref
Original definition
# Cache condition settings
## Definition
~~~json
{
"isOn": "Whether this configuration is enabled",
"key": "Cache key rule; may contain variables",
"life": "Cache lifetime",
"expiresTime": "Client-side expiration time",
"status": ["Cacheable status code 1", "Cacheable status code 2", ...],
"minSize": "Minimum cacheable size",
"maxSize": "Maximum cacheable size",
"methods": ["Supported request method 1", "Supported request method 2", ...],
"skipCacheControlValues": "Response Cache-Control values that bypass caching",
"skipSetCookie": "Whether to skip the response Set-Cookie header",
"enableRequestCachePragma": "Whether to honor the client's Pragma: no-cache",
"allowChunkedEncoding": "Whether chunked content is allowed",
"allowPartialContent": "Whether partial content caching is supported",
"conds": "Request conditions",
"isReverse": "Whether this is an exclusion condition; matching content is not cached"
}
~~~
## Examples
~~~json
{
"isOn": true,
"key": "${scheme}://${host}${requestURI}",
"life": {
"count": 1,
"unit": "day"
},
"expiresTime": {
"isPrior": true,
"isOn": true,
"overwrite": true,
"autoCalculate": false,
"duration": {
"count": 1,
"unit": "day"
}
},
"status": [
200
],
"minSize": {
"count": 0,
"unit": "kb"
},
"maxSize": {
"count": 32,
"unit": "mb"
},
"methods": [],
"skipCacheControlValues": [
"private",
"no-cache",
"no-store"
],
"skipSetCookie": true,
"enableRequestCachePragma": false,
"allowChunkedEncoding": true,
"allowPartialContent": false,
"conds": {
"isOn": true,
"connector": "or",
"groups": [
{
"isOn": true,
"connector": "and",
"conds": [
{
"type": "url-extension",
"isRequest": true,
"param": "${requestPathLowerExtension}",
"operator": "in",
"value": "[\".css\",\".png\",\".js\",\".woff2\"]",
"isReverse": false,
"isCaseInsensitive": false,
"typeName": "URL扩展名"
}
],
"isReverse": false,
"description": ""
}
]
},
"cachePolicy": null,
"isReverse": false,
"id": 1
}
~~~