Cache
Trong trang này
- List cache policies with their rules
- Create a cache policy, optionally from a preset
- One cache policy
- Replace a cache policy and republish the servers using it
- Delete a cache policy; domains fall back to the default policy
- Built-in policy presets
- Cache hit ratio and memory use over time. Query: server_id, hours (1 to 336)
- Cache memory share, optional ceiling, and the cap in effect
- Set how much host memory the cache may use (admin, write)
- Turn caching on or off for a domain and choose its policy
- Counters and usage from a server's cache
- Cache settings and counters for a service's domains
- Purge cached objects for a service's domains
HTTP cache policies, purge, and stats
List cache policies with their rules
/api/v1/cache-policiesPhản hồi
200 List cache policies with their rules
CachePolicyView[]created_atstring (date-time)bắt buộcdescriptionstringbắt buộcdisk_max_bytesinteger | null (int64)Share of the server's disk store. Null or all-null policies keep objects in memory only.
domainsinteger (int64)bắt buộcDomains that use this policy.
idstring (uuid)bắt buộcmax_object_bytesinteger | null (int64)Largest response body stored. Null means 16 MiB.
memory_max_bytesinteger | null (int64)Share of the server's memory store. Null uses the default (256 MiB in total).
namestringbắt buộcrulesCacheRule[]bắt buộcCacheRule[]
actionRuleActionbắt buộcRuleAction
bypass_cookiesstring[]With
cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.cache_cookiesbooleanLook up and store requests that carry a
Cookieheader. Off by default: any request with a cookie skips the cache.ignore_querybooleanDrop the query string from the cache key.
modeRuleMode"cache" · "bypass"query_keysstring[]When non-empty, only these query parameters are part of the key (sorted).
respect_originbooleanUse
s-maxage/max-agefrom the origin when present, and honorno-store/private.stale_if_error_secsinteger (int32)stale_while_revalidate_secsinteger (int32)statusesinteger (int32)[]Response statuses that may be stored.
ttl_secsinteger (int32)Freshness when the origin gives none, or always when
respect_originis false.
matchRuleMatchEvery set field must match. An empty matcher matches every request.
RuleMatch
extensionsstring[]File extensions without the dot, compared case-insensitively.
path_globstring | null*matches any run of characters; anchored at both ends.path_prefixesstring[]Path must start with one of these.
namestring
updated_atstring (date-time)bắt buộc
Create a cache policy, optionally from a preset
/api/v1/cache-policiesNội dung gửi lênapplication/json
SaveCachePolicy
descriptionstring | nulldisk_max_bytesinteger | null (int64)max_object_bytesinteger | null (int64)memory_max_bytesinteger | null (int64)namestringbắt buộcpresetstring | nullPreset slug to start from when creating.
rulesCacheRule[]Ordered rules; the first match wins. Defaults to the preset's rules on create.
CacheRule[]
actionRuleActionbắt buộcRuleAction
bypass_cookiesstring[]With
cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.cache_cookiesbooleanLook up and store requests that carry a
Cookieheader. Off by default: any request with a cookie skips the cache.ignore_querybooleanDrop the query string from the cache key.
modeRuleMode"cache" · "bypass"RuleMode
"cache" · "bypass"
query_keysstring[]When non-empty, only these query parameters are part of the key (sorted).
respect_originbooleanUse
s-maxage/max-agefrom the origin when present, and honorno-store/private.stale_if_error_secsinteger (int32)stale_while_revalidate_secsinteger (int32)statusesinteger (int32)[]Response statuses that may be stored.
ttl_secsinteger (int32)Freshness when the origin gives none, or always when
respect_originis false.
matchRuleMatchEvery set field must match. An empty matcher matches every request.
RuleMatch
extensionsstring[]File extensions without the dot, compared case-insensitively.
path_globstring | null*matches any run of characters; anchored at both ends.path_prefixesstring[]Path must start with one of these.
namestring
Phản hồi
201 Create a cache policy, optionally from a preset
CachePolicyViewcreated_atstring (date-time)bắt buộcdescriptionstringbắt buộcdisk_max_bytesinteger | null (int64)Share of the server's disk store. Null or all-null policies keep objects in memory only.
domainsinteger (int64)bắt buộcDomains that use this policy.
idstring (uuid)bắt buộcmax_object_bytesinteger | null (int64)Largest response body stored. Null means 16 MiB.
memory_max_bytesinteger | null (int64)Share of the server's memory store. Null uses the default (256 MiB in total).
namestringbắt buộcrulesCacheRule[]bắt buộcCacheRule[]
actionRuleActionbắt buộcRuleAction
bypass_cookiesstring[]With
cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.cache_cookiesbooleanLook up and store requests that carry a
Cookieheader. Off by default: any request with a cookie skips the cache.ignore_querybooleanDrop the query string from the cache key.
modeRuleMode"cache" · "bypass"RuleMode
"cache" · "bypass"
query_keysstring[]When non-empty, only these query parameters are part of the key (sorted).
respect_originbooleanUse
s-maxage/max-agefrom the origin when present, and honorno-store/private.stale_if_error_secsinteger (int32)stale_while_revalidate_secsinteger (int32)statusesinteger (int32)[]Response statuses that may be stored.
ttl_secsinteger (int32)Freshness when the origin gives none, or always when
respect_originis false.
matchRuleMatchEvery set field must match. An empty matcher matches every request.
RuleMatch
extensionsstring[]File extensions without the dot, compared case-insensitively.
path_globstring | null*matches any run of characters; anchored at both ends.path_prefixesstring[]Path must start with one of these.
namestring
updated_atstring (date-time)bắt buộc
One cache policy
/api/v1/cache-policies/{id}Phản hồi
200 One cache policy
CachePolicyViewcreated_atstring (date-time)bắt buộcdescriptionstringbắt buộcdisk_max_bytesinteger | null (int64)Share of the server's disk store. Null or all-null policies keep objects in memory only.
domainsinteger (int64)bắt buộcDomains that use this policy.
idstring (uuid)bắt buộcmax_object_bytesinteger | null (int64)Largest response body stored. Null means 16 MiB.
memory_max_bytesinteger | null (int64)Share of the server's memory store. Null uses the default (256 MiB in total).
namestringbắt buộcrulesCacheRule[]bắt buộcCacheRule[]
actionRuleActionbắt buộcRuleAction
bypass_cookiesstring[]With
cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.cache_cookiesbooleanLook up and store requests that carry a
Cookieheader. Off by default: any request with a cookie skips the cache.ignore_querybooleanDrop the query string from the cache key.
modeRuleMode"cache" · "bypass"RuleMode
"cache" · "bypass"
query_keysstring[]When non-empty, only these query parameters are part of the key (sorted).
respect_originbooleanUse
s-maxage/max-agefrom the origin when present, and honorno-store/private.stale_if_error_secsinteger (int32)stale_while_revalidate_secsinteger (int32)statusesinteger (int32)[]Response statuses that may be stored.
ttl_secsinteger (int32)Freshness when the origin gives none, or always when
respect_originis false.
matchRuleMatchEvery set field must match. An empty matcher matches every request.
RuleMatch
extensionsstring[]File extensions without the dot, compared case-insensitively.
path_globstring | null*matches any run of characters; anchored at both ends.path_prefixesstring[]Path must start with one of these.
namestring
updated_atstring (date-time)bắt buộc
Replace a cache policy and republish the servers using it
/api/v1/cache-policies/{id}Nội dung gửi lênapplication/json
SaveCachePolicy
descriptionstring | nulldisk_max_bytesinteger | null (int64)max_object_bytesinteger | null (int64)memory_max_bytesinteger | null (int64)namestringbắt buộcpresetstring | nullPreset slug to start from when creating.
rulesCacheRule[]Ordered rules; the first match wins. Defaults to the preset's rules on create.
CacheRule[]
actionRuleActionbắt buộcRuleAction
bypass_cookiesstring[]With
cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.cache_cookiesbooleanLook up and store requests that carry a
Cookieheader. Off by default: any request with a cookie skips the cache.ignore_querybooleanDrop the query string from the cache key.
modeRuleMode"cache" · "bypass"RuleMode
"cache" · "bypass"
query_keysstring[]When non-empty, only these query parameters are part of the key (sorted).
respect_originbooleanUse
s-maxage/max-agefrom the origin when present, and honorno-store/private.stale_if_error_secsinteger (int32)stale_while_revalidate_secsinteger (int32)statusesinteger (int32)[]Response statuses that may be stored.
ttl_secsinteger (int32)Freshness when the origin gives none, or always when
respect_originis false.
matchRuleMatchEvery set field must match. An empty matcher matches every request.
RuleMatch
extensionsstring[]File extensions without the dot, compared case-insensitively.
path_globstring | null*matches any run of characters; anchored at both ends.path_prefixesstring[]Path must start with one of these.
namestring
Phản hồi
200 Replace a cache policy and republish the servers using it
CachePolicyViewcreated_atstring (date-time)bắt buộcdescriptionstringbắt buộcdisk_max_bytesinteger | null (int64)Share of the server's disk store. Null or all-null policies keep objects in memory only.
domainsinteger (int64)bắt buộcDomains that use this policy.
idstring (uuid)bắt buộcmax_object_bytesinteger | null (int64)Largest response body stored. Null means 16 MiB.
memory_max_bytesinteger | null (int64)Share of the server's memory store. Null uses the default (256 MiB in total).
namestringbắt buộcrulesCacheRule[]bắt buộcCacheRule[]
actionRuleActionbắt buộcRuleAction
bypass_cookiesstring[]With
cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.cache_cookiesbooleanLook up and store requests that carry a
Cookieheader. Off by default: any request with a cookie skips the cache.ignore_querybooleanDrop the query string from the cache key.
modeRuleMode"cache" · "bypass"RuleMode
"cache" · "bypass"
query_keysstring[]When non-empty, only these query parameters are part of the key (sorted).
respect_originbooleanUse
s-maxage/max-agefrom the origin when present, and honorno-store/private.stale_if_error_secsinteger (int32)stale_while_revalidate_secsinteger (int32)statusesinteger (int32)[]Response statuses that may be stored.
ttl_secsinteger (int32)Freshness when the origin gives none, or always when
respect_originis false.
matchRuleMatchEvery set field must match. An empty matcher matches every request.
RuleMatch
extensionsstring[]File extensions without the dot, compared case-insensitively.
path_globstring | null*matches any run of characters; anchored at both ends.path_prefixesstring[]Path must start with one of these.
namestring
updated_atstring (date-time)bắt buộc
Delete a cache policy; domains fall back to the default policy
/api/v1/cache-policies/{id}Phản hồi
- 204 Delete a cache policy; domains fall back to the default policy
Built-in policy presets
/api/v1/cache-presetsPhản hồi
200 Built-in policy presets
CachePresetView[]descriptionstringbắt buộcnamestringbắt buộcrulesCacheRule[]bắt buộcCacheRule[]
actionRuleActionbắt buộcRuleAction
bypass_cookiesstring[]With
cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.cache_cookiesbooleanLook up and store requests that carry a
Cookieheader. Off by default: any request with a cookie skips the cache.ignore_querybooleanDrop the query string from the cache key.
modeRuleMode"cache" · "bypass"query_keysstring[]When non-empty, only these query parameters are part of the key (sorted).
respect_originbooleanUse
s-maxage/max-agefrom the origin when present, and honorno-store/private.stale_if_error_secsinteger (int32)stale_while_revalidate_secsinteger (int32)statusesinteger (int32)[]Response statuses that may be stored.
ttl_secsinteger (int32)Freshness when the origin gives none, or always when
respect_originis false.
matchRuleMatchEvery set field must match. An empty matcher matches every request.
RuleMatch
extensionsstring[]File extensions without the dot, compared case-insensitively.
path_globstring | null*matches any run of characters; anchored at both ends.path_prefixesstring[]Path must start with one of these.
namestring
slugstringbắt buộc
Cache hit ratio and memory use over time. Query: server_id, hours (1 to 336)
/api/v1/cache/historyPhản hồi
200 Cache hit ratio and memory use over time. Query: server_id, hours (1 to 336)
CacheServerHistory[]namestringbắt buộcpointsCachePoint[]bắt buộcCachePoint[]
bytes_servedinteger (int64)bắt buộcevictionsinteger (int64)bắt buộchit_rationumber | null (double)Hit ratio since the previous sample, from 0 to 1. Null when nothing was served.
hitsinteger (int64)bắt buộcmemory_max_bytesinteger (int64)bắt buộcmissesinteger (int64)bắt buộcsampled_atstring (date-time)bắt buộcstored_bytesinteger (int64)bắt buộc
server_idstring (uuid)bắt buộc
Cache memory share, optional ceiling, and the cap in effect
/api/v1/cache/settingsPhản hồi
200 Cache memory share, optional ceiling, and the cap in effect
CacheSettingsVieweffective_cap_bytesinteger (int64)bắt buộcThe most bytes a rules file will ask the cache to store right now.
host_memory_bytesinteger | null (int64)memory_cap_bytesinteger | null (int64)memory_percentinteger (int32)bắt buộc
Set how much host memory the cache may use (admin, write)
/api/v1/cache/settingsNội dung gửi lênapplication/json
UpdateCacheSettings
memory_cap_bytesinteger | null (int64)Blank clears the extra ceiling. 16 MiB to 4 GiB.
memory_percentinteger (int32)bắt buộc
Phản hồi
200 Set how much host memory the cache may use (admin, write)
CacheSettingsVieweffective_cap_bytesinteger (int64)bắt buộcThe most bytes a rules file will ask the cache to store right now.
host_memory_bytesinteger | null (int64)memory_cap_bytesinteger | null (int64)memory_percentinteger (int32)bắt buộc
Turn caching on or off for a domain and choose its policy
/api/v1/domains/{id}/cacheNội dung gửi lênapplication/json
UpdateDomainCache
enabledbooleanbắt buộcpolicy_idstring | null (uuid)Null uses the built-in "Honor origin headers" policy.
Phản hồi
200 Turn caching on or off for a domain and choose its policy
DomainCacheViewdomain_idstring (uuid)bắt buộcenabledbooleanbắt buộchoststringbắt buộcpath_prefixstringbắt buộcpolicy_idstring | null (uuid)policy_namestring | null
Counters and usage from a server's cache
/api/v1/servers/{id}/cache/statsPhản hồi
200 Counters and usage from a server's cache
CacheStatsdisk_max_bytesinteger (int64)Disk budget. Zero when the tier is off.
disk_objectsinteger (int64)Objects in the disk tier. Zero when the tier is off.
disk_stored_bytesinteger (int64)Bytes in the disk tier.
evictionsinteger (int64)bắt buộchostsCacheHostStats[]bắt buộcCacheHostStats[]
bypassinteger (int64)bắt buộcbytes_servedinteger (int64)bắt buộchitsinteger (int64)bắt buộchoststringbắt buộcmissesinteger (int64)bắt buộcobjectsinteger (int64)bắt buộcstaleinteger (int64)bắt buộcstored_bytesinteger (int64)bắt buộc
memory_max_bytesinteger (int64)bắt buộcobjectsinteger (int64)bắt buộcreloadsinteger (int64)bắt buộcrules_versioninteger (int64)bắt buộcstored_bytesinteger (int64)bắt buộcversionstringbắt buộc
Cache settings and counters for a service's domains
/api/v1/services/{id}/cachePhản hồi
200 Cache settings and counters for a service's domains
ServiceCacheViewdomainsDomainCacheView[]bắt buộcDomainCacheView[]
domain_idstring (uuid)bắt buộcenabledbooleanbắt buộchoststringbắt buộcpath_prefixstringbắt buộcpolicy_idstring | null (uuid)policy_namestring | null
statsCacheHostStats[]bắt buộcCounters for this service's cached hosts.
CacheHostStats[]
bypassinteger (int64)bắt buộcbytes_servedinteger (int64)bắt buộchitsinteger (int64)bắt buộchoststringbắt buộcmissesinteger (int64)bắt buộcobjectsinteger (int64)bắt buộcstaleinteger (int64)bắt buộcstored_bytesinteger (int64)bắt buộc
stats_errorstring | nullWhy stats are missing, such as an unreachable cache server.
Purge cached objects for a service's domains
/api/v1/services/{id}/cache/purgeNội dung gửi lênapplication/json
ServiceCachePurge
allboolean | nulldomain_idstring | null (uuid)Limit the purge to one domain. Defaults to every cached domain of the service.
pathsstring[]prefixstring | null
Phản hồi
200 Purge cached objects for a service's domains
CachePurgeResultremovedinteger (int64)bắt buộc