Adding a cache setting entry for a subdomain¶
Note
If the optional attributes are not set, the system adds a default value.
Note
The body does not contain the attributes id, created, and modified. The system sets the values of these attributes after the entry is created.
Sends a POST request to the endpoint /tag/{tagId}/cache-settings.
Description¶
The Add-Cache-Settings request allows the user to add one or more entries for cache settings for a subdomain of the organisation.
Requirements¶
Values of the request: Domain-ID {domainId}, Subdomain name {vHostName}
Objects: CacheSettingVO
Request¶
To add one or more entries for cache settings for a subdomain, the Domain-ID {domainId} and the Subdomain name {vHostName} need to be added to the path of the request.
For a detailed specification of which information is required to add an entry for cache settings for a subdomain, one or more objects CacheSettingVO with the following attributes need to be defined in the body:
| Attributes | Description | Values |
|---|---|---|
path |
The path that must match the cache response. A request is matched against the path to decide whether the request is cacheable or not. A regular expression can be specified in the attribute. The regex characters for start ˆ or end $ must not be used, because they are generated depending on the specified type. |
string |
ttl |
The time to live in seconds. |
|
noFoundttl |
The duration for which an object is cached. Origin responses with the HTTP code 404 are cached. |
|
Type |
The condition for the alignment. |
|
enforce |
The availability of forcing the cache TTL. Forcing the cache TTL makes it possible to set the cache TTL (Cache-Control: max-age) in the backend independently of the response of the customer infrastructure. |
|
sort |
The ascending order for the entry. | integer |
The following attributes are optional:
| Attributes | Description | Values |
|---|---|---|
enabled |
The availability of the entry. |
|
comment |
An individual comment for the entry. | string |
The system responds by returning the object CacheSettingVO with the information about the new entry.
Example¶
Example request body:
{
"objectType": "string",
"path": "string",
"ttl": 0,
"notFoundTtl": 0,
"type": "string",
"enforce": true,
"sort": 0,
"comment": "string",
"enabled": true
}
Responses¶
The following responses are available:
| STATUS CODE | DESCRIPTION |
|---|---|
| 201 | The request has succeeded and a new object has been created. |
| 400 | The request was unsuccessful. The request was invalid or information is missing. |
| 401 | The request has not succeeded because the user authentication was incorrect. |
| 403 | The request has not succeeded because the user does not have the right permissions. |