Skip to main content

Get Cache Control Rules

Retrieves a list of cache control rules for website accleration domain.

Request

Request-Line

GET /waap/v1.0/services/{serviceId}/cacheControls HTTP/1.1

Request Parameters

Path Parameters

ParameterTypeRequiredDescription
serviceIdIntegerMandatoryService ID.

Response

Response Body

ParameterTypeRequiredDescription
ArrayMandatoryArray of Url Cache Controls Rule.

Object: Url Cache Controls Rule

ParameterTypeRequiredDescription
ruleIdIntegerMandatoryRule ID number for access control.
nameStringMandatoryRule name for access control.
matchUrlPathObjectMandatoryURL path matching configuration that determines which requests the rule applies to. See Match Url Path for details.
matchQueryStringObjectOptionalQuery-string matching configuration used to refine which requests the rule applies to. See Match Query String for details.
priorityIntegerMandatoryPriority weight for the rule. Rules with a higher weight take precedence. The weight must be non-zero.
ttlLongOptionalTime-to-live (TTL) in seconds for content cached at the edge. If omitted, the origin cache TTL is used.
ignoreClientNoCacheBooleanOptionalIndicates whether to ignore no-cache headers sent by the client. Accepts true or false.
ignoreOriginNoCacheBooleanOptionalIndicates whether to ignore no-cache headers sent by the origin server. Accepts true or false.
ignoreQueryStringBooleanOptionalIndicates whether to ignore the URL query string when caching content. Accepts true or false.
enableXCacheBooleanOptionalWhen enabled, all responses from the edge include an X-Cache header (e.g., "HIT from da01.xy01.swiftserve.com"), indicating whether the response was served from cache (fully or partially) or not.
neverCacheBooleanOptionalPrevents content from being cached, even if the origin marks it as cacheable.
varyMIMEsString[]OptionalConfigures so-called "vary for images" feature. Contains a list of mime types, preferred for objects matched by the rule. Supported values: image/webp, image/avif, image/jpeg, image/jpg, image/png
enabledBooleanOptionalIndicates whether the rule is enabled.
Object: Match Url Path
ParameterTypeRequiredDescription
operatorStringMandatoryDefines how to match the field. Supported values:prefix,regex,equals,suffix.
patternsString[]MandatoryList of patterns matching the URL path/query string.
Object: Match Query String
ParameterTypeRequiredDescription
operatorStringMandatoryDefines how to match the field. Supported values:prefix,regex,equals,suffix.
patternsString[]MandatoryList of patterns matching the URL path/query string.

Status Codes, Error Codes and Error Messages

Status CodeError CodeError Message
400ServiceId.InvalidServiceId is empty or invalid.
400CacheControl.OperationFailedThe cache control operation failed.
404ServiceId.NotFoundServiceId is not found.

Examples

Get Cache Control Rules

Request

GET /waap/v1.0/services/12345/cacheControls HTTP/1.1

Successful Response Body

[
{
"ruleId": 261699,
"name": "test1",
"matchUrlPath": {
"operator": "prefix",
"patterns": [
"/"
]
},
"priority": 1023,
"ignoreClientNoCache": false,
"ignoreOriginNoCache": false,
"ignoreQueryString": false,
"enableXCache": false,
"neverCache": false,
"enabled": true
},
{
"ruleId": 261700,
"name": "test",
"matchUrlPath": {
"operator": "prefix",
"patterns": [
"/"
]
},
"matchQueryString": {
"operator": "prefix",
"patterns": [
"name1=1",
"name2=2"
]
},
"priority": 1,
"ttl": 100,
"ignoreClientNoCache": true,
"ignoreOriginNoCache": false,
"ignoreQueryString": false,
"enableXCache": false,
"neverCache": false,
"varyMIMEs": [
"image/jpg"
],
"enabled": true
}
]