List Cache Controls
This API is used to list cache controls for website accleration service.
Request
Request-Line
GET /cdn/v1.0/services/{serviceId}/cacheControl HTTP/1.1
Request Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| serviceId | Integer | Mandatory | Service id. |
Response
Response Body
| Parameter | Type | Description |
|---|---|---|
| Array | Array of Cache Controls. |
Object: Cache Control
| Parameter | Type | Description |
|---|---|---|
| policyId | String | Policy ID number for cache control. |
| policyName | String | Policy name for cache control. |
| matchUrlPath | Object | URL path matching configuration that determines which requests the rule applies to. See Match Url Path for details. |
| priority | Integer | Priority weight for the rule. Rules with a higher weight take precedence. The weight must be non-zero. |
| ignoreClientNoCache | Boolean | True or false to ignore no-cache header(s) sent by the client. Default is false. |
| ignoreOriginNoCache | Boolean | True or false to ignore no-cache header(s) sent by the origin server. Default is false. |
| ignoreQueryString | Boolean | True or false to ignore any URL query string when caching contents. Default is false. |
| enableXCache | Boolean | When enabled all responses from the edge have X-Cache header with values like "HIT from da01.xy01.swiftserve.com", showing whether the response was served from the cache (at least partially) or not. Default is false. |
| noCache | Boolean | Do not cache the content even if the origin presents it as cacheable. Default is false. |
| autoGzip | Boolean | automatic gzipping on the CDN side. Default is false. |
| responseHeaders | Array | List of response header configuration. See Response Headers for details. |
| matchQueryString | Object | Query-string matching configuration used to refine which requests the rule applies to. See Match Query String for details. |
| ttl | Long | The cache TTL for contents to be cached on edge server in seconds. |
| refererAcl | Object | Configure resource references by creating a domain list and selecting a configuration type (e.g.,whitelist,blacklist) to control whether a domain has permission to access the resource,thereby ensuring resource security. see Referer Acl for details |
| originAcl | Object | Configure origins by creating a domain list and selecting a configuration type (e.g.,whitelist,blacklist) to control whether a domain has permission to access data from origin,thereby ensuring resource security. see Origin Acl for details |
| varyMIMEs | String[] | Configures so-called "vary for images" feature.Contains a list of mime types, preferred for objects matched by the policy. |
| enabled | Boolean | Flag defining if policy is active or no. default is true. |
Object: Match Url Path
| Parameter | Type | Description |
|---|---|---|
| operator | String | Defines how to match the field. Supported values:prefix,regex,equals,suffix. |
| patterns | String[] | List of patterns matching the URL path string. |
Object: Match Query String
| Parameter | Type | Description |
|---|---|---|
| operator | String | Defines how to match the field. Supported values:prefix,regex,equals,suffix. |
| patterns | String[] | List of patterns matching the URL query string. |
Object: Referer/Origin Acl
| Parameter | Type | Description |
|---|---|---|
| aclType | String | Types of blacklists and whitelists |
| domainList | String[] | List of domain. |
Object: Response Headers
| Parameter | Type | Description |
|---|---|---|
| name | String | Response Header Name. |
| operationType | String | Operation type of response header policy, could be "add" or "replace" or "delete" |
| value | String | Response Header Value. |
Status Codes, Error Codes and Error Messages
| Status Code | Error Code | Error Message |
|---|---|---|
| 400 | InvalidService.IdIncorrect | Service id is empty or invalid. |
Examples
List Cache Controls
Request
GET /cdn/v1.0/services/100000000/cacheControl HTTP/1.1
Successful Response Body
[
{
"policyId": 261885,
"policyName": "redirectionInfo",
"redirectDestination": "www.example.com",
"httpCode": 301,
"matchUrlPath": {
"operator": "prefix",
"patterns": [
"/"
]
},
"priority": 333,
"enabled": true
},
{
"policyId": 261887,
"policyName": "redirection",
"redirectDestination": "www.example.com",
"httpCode": 301,
"matchUrlPath": {
"operator": "prefix",
"patterns": [
"/"
]
},
"priority": 333,
"enabled": true
},
{
"policyId": 261888,
"policyName": "resu",
"redirectDestination": "www.example.com",
"httpCode": 301,
"matchUrlPath": {
"operator": "prefix",
"patterns": [
"/"
]
},
"priority": 333,
"enabled": true
},
{
"policyId": 261953,
"policyName": "redo",
"redirectDestination": "www.domain333.com",
"httpCode": 302,
"matchUrlPath": {
"operator": "prefix",
"patterns": [
"/"
]
},
"priority": 1,
"enabled": true
}
]