Create Cache Control

This API is used to create cache control for website acceleration or file download service.

1. Request Definition

  • API URL
https://cdn-api.swiftfederation.com/v1.1/services/{serviceId}/cache_controls
  • Request Method
POST
  • Request Header

Refer to HTTP Request Headers

  • Request Body

Request Body Data Format: JSON

Field Required Type Description
name Mandatory string Policy name for access control.
matchType Mandatory string Policy match type, could be "regex" or "prefix".
url Mandatory string Prefix or regex of url pattern.
hostHeader Optional string 'Host' header to be sent to the origin (only valid on WSA properties)
ttl Optional long The cache TTL for contents to be cached on edge server in seconds.
allowedReferrers Optional string Comma-separated list of domain suffixes. If the Referer header of a client request does not match any of the suffixes in the list then the request is blocked with an HTTP 403 Permission Denied response. Suffixes match any domain name with the same ending, for example "example.com" will match both "www.example.com" and "subdomain.example.com".
ignoreClientNoCache Optional boolean True or false to ignore no-cache header(s) sent by the client.
ignoreOriginNoCache Optional boolean True or false to ignore no-cache header(s) sent by the origin server.
ignoreQueryString Optional boolean True or false to ignore any URL query string when caching contents.
  • Request Body Example
{
    "name": "cc2001",
    "matchType": "regex",
    "url": "/*.js",
    "hostHeader": "cdn.example1.com",
    "ttl": 86400,
    "ignoreClientNoCache": true,
    "ignoreOriginNoCache": true,
    "ignoreQueryString": false
}


2. Response Definition

  • Response Header

Refer to HTTP Response Headers

  • Response Body
Field Type Description
id int Policy ID number for access control.
name string Policy name for access control.
matchType string Policy match type, could be "regex" or "prefix".
url string Prefix or regex of url pattern.
hostHeader string 'Host' header to be sent to the origin (only valid on WSA properties)
ttl long The cache TTL for contents to be cached on edge server in seconds.
ignoreClientNoCache boolean True or false to ignore no-cache header(s) sent by the client.
ignoreOriginNoCache boolean True or false to ignore no-cache header(s) sent by the origin server.
ignoreQueryString boolean True or false to ignore any URL query string when caching contents.
  • Response Body Example
{
    "id": 2001,
    "name": "cc1001",
    "matchType": "regex",
    "url": "/*.js",
    "hostHeader": "cdn.example1.com",
    "ttl": 86400,
    "ignoreClientNoCache": true,
    "ignoreOriginNoCache": true,
    "ignoreQueryString": false
}
© 2019 Conversant Solutions Pte Ltd. All rights reserved.            Updated 2019-03-12 05:48:31

results matching ""

    No results matching ""