Replace cache configuration
PUT
/
cloud-cdn
/
distributions
/
configurations
/
cache
Replace cache configuration
curl --request PUT \
--url https://api.aptranet.com/cloud-cdn/distributions/configurations/cache \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"edge_cache": {
"enabled": true,
"ttl": 1
},
"browser_cache": {
"enabled": true,
"ttl": 1
},
"cache_key": {
"ignore_set_cookie": true,
"ignore_query_string": {
"enabled": true,
"params": [
"<string>"
]
}
},
"stale": {
"enabled": true,
"codes": [
"<string>"
]
},
"slice": {
"enabled": true
},
"cache_post_requests": {
"enabled": true
},
"custom_cache_key": {
"enabled": true,
"value": "<string>"
}
}
'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/configurations/cache"
payload = {
"edge_cache": {
"enabled": True,
"ttl": 1
},
"browser_cache": {
"enabled": True,
"ttl": 1
},
"cache_key": {
"ignore_set_cookie": True,
"ignore_query_string": {
"enabled": True,
"params": ["<string>"]
}
},
"stale": {
"enabled": True,
"codes": ["<string>"]
},
"slice": { "enabled": True },
"cache_post_requests": { "enabled": True },
"custom_cache_key": {
"enabled": True,
"value": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
edge_cache: {enabled: true, ttl: 1},
browser_cache: {enabled: true, ttl: 1},
cache_key: {
ignore_set_cookie: true,
ignore_query_string: {enabled: true, params: ['<string>']}
},
stale: {enabled: true, codes: ['<string>']},
slice: {enabled: true},
cache_post_requests: {enabled: true},
custom_cache_key: {enabled: true, value: '<string>'}
})
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/configurations/cache', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-cdn/distributions/configurations/cache"
payload := strings.NewReader("{\n \"edge_cache\": {\n \"enabled\": true,\n \"ttl\": 1\n },\n \"browser_cache\": {\n \"enabled\": true,\n \"ttl\": 1\n },\n \"cache_key\": {\n \"ignore_set_cookie\": true,\n \"ignore_query_string\": {\n \"enabled\": true,\n \"params\": [\n \"<string>\"\n ]\n }\n },\n \"stale\": {\n \"enabled\": true,\n \"codes\": [\n \"<string>\"\n ]\n },\n \"slice\": {\n \"enabled\": true\n },\n \"cache_post_requests\": {\n \"enabled\": true\n },\n \"custom_cache_key\": {\n \"enabled\": true,\n \"value\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}Authorizations
Access key beginning with APTRANET_.
Current secret paired with the access key.
Query Parameters
Distribution identifier.
Required range:
x >= 1Body
application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Cache configuration updated.
Replace cache configuration
curl --request PUT \
--url https://api.aptranet.com/cloud-cdn/distributions/configurations/cache \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"edge_cache": {
"enabled": true,
"ttl": 1
},
"browser_cache": {
"enabled": true,
"ttl": 1
},
"cache_key": {
"ignore_set_cookie": true,
"ignore_query_string": {
"enabled": true,
"params": [
"<string>"
]
}
},
"stale": {
"enabled": true,
"codes": [
"<string>"
]
},
"slice": {
"enabled": true
},
"cache_post_requests": {
"enabled": true
},
"custom_cache_key": {
"enabled": true,
"value": "<string>"
}
}
'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/configurations/cache"
payload = {
"edge_cache": {
"enabled": True,
"ttl": 1
},
"browser_cache": {
"enabled": True,
"ttl": 1
},
"cache_key": {
"ignore_set_cookie": True,
"ignore_query_string": {
"enabled": True,
"params": ["<string>"]
}
},
"stale": {
"enabled": True,
"codes": ["<string>"]
},
"slice": { "enabled": True },
"cache_post_requests": { "enabled": True },
"custom_cache_key": {
"enabled": True,
"value": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
edge_cache: {enabled: true, ttl: 1},
browser_cache: {enabled: true, ttl: 1},
cache_key: {
ignore_set_cookie: true,
ignore_query_string: {enabled: true, params: ['<string>']}
},
stale: {enabled: true, codes: ['<string>']},
slice: {enabled: true},
cache_post_requests: {enabled: true},
custom_cache_key: {enabled: true, value: '<string>'}
})
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/configurations/cache', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-cdn/distributions/configurations/cache"
payload := strings.NewReader("{\n \"edge_cache\": {\n \"enabled\": true,\n \"ttl\": 1\n },\n \"browser_cache\": {\n \"enabled\": true,\n \"ttl\": 1\n },\n \"cache_key\": {\n \"ignore_set_cookie\": true,\n \"ignore_query_string\": {\n \"enabled\": true,\n \"params\": [\n \"<string>\"\n ]\n }\n },\n \"stale\": {\n \"enabled\": true,\n \"codes\": [\n \"<string>\"\n ]\n },\n \"slice\": {\n \"enabled\": true\n },\n \"cache_post_requests\": {\n \"enabled\": true\n },\n \"custom_cache_key\": {\n \"enabled\": true,\n \"value\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}