Cache
On this page
- 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-policiesResponses
200 List cache policies with their rules
CachePolicyView[]created_atstring (date-time)requireddescriptionstringrequireddisk_max_bytesinteger | null (int64)Share of the server's disk store. Null or all-null policies keep objects in memory only.
domainsinteger (int64)requiredDomains that use this policy.
idstring (uuid)requiredmax_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).
namestringrequiredrulesCacheRule[]requiredCacheRule[]
actionRuleActionrequiredRuleAction
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)required
Create a cache policy, optionally from a preset
/api/v1/cache-policiesRequest bodyapplication/json
SaveCachePolicy
descriptionstring | nulldisk_max_bytesinteger | null (int64)max_object_bytesinteger | null (int64)memory_max_bytesinteger | null (int64)namestringrequiredpresetstring | nullPreset slug to start from when creating.
rulesCacheRule[]Ordered rules; the first match wins. Defaults to the preset's rules on create.
CacheRule[]
actionRuleActionrequiredRuleAction
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
Responses
201 Create a cache policy, optionally from a preset
CachePolicyViewcreated_atstring (date-time)requireddescriptionstringrequireddisk_max_bytesinteger | null (int64)Share of the server's disk store. Null or all-null policies keep objects in memory only.
domainsinteger (int64)requiredDomains that use this policy.
idstring (uuid)requiredmax_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).
namestringrequiredrulesCacheRule[]requiredCacheRule[]
actionRuleActionrequiredRuleAction
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)required
One cache policy
/api/v1/cache-policies/{id}Responses
200 One cache policy
CachePolicyViewcreated_atstring (date-time)requireddescriptionstringrequireddisk_max_bytesinteger | null (int64)Share of the server's disk store. Null or all-null policies keep objects in memory only.
domainsinteger (int64)requiredDomains that use this policy.
idstring (uuid)requiredmax_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).
namestringrequiredrulesCacheRule[]requiredCacheRule[]
actionRuleActionrequiredRuleAction
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)required
Replace a cache policy and republish the servers using it
/api/v1/cache-policies/{id}Request bodyapplication/json
SaveCachePolicy
descriptionstring | nulldisk_max_bytesinteger | null (int64)max_object_bytesinteger | null (int64)memory_max_bytesinteger | null (int64)namestringrequiredpresetstring | nullPreset slug to start from when creating.
rulesCacheRule[]Ordered rules; the first match wins. Defaults to the preset's rules on create.
CacheRule[]
actionRuleActionrequiredRuleAction
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
Responses
200 Replace a cache policy and republish the servers using it
CachePolicyViewcreated_atstring (date-time)requireddescriptionstringrequireddisk_max_bytesinteger | null (int64)Share of the server's disk store. Null or all-null policies keep objects in memory only.
domainsinteger (int64)requiredDomains that use this policy.
idstring (uuid)requiredmax_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).
namestringrequiredrulesCacheRule[]requiredCacheRule[]
actionRuleActionrequiredRuleAction
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)required
Delete a cache policy; domains fall back to the default policy
/api/v1/cache-policies/{id}Responses
- 204 Delete a cache policy; domains fall back to the default policy
Built-in policy presets
/api/v1/cache-presetsResponses
200 Built-in policy presets
CachePresetView[]descriptionstringrequirednamestringrequiredrulesCacheRule[]requiredCacheRule[]
actionRuleActionrequiredRuleAction
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
slugstringrequired
Cache hit ratio and memory use over time. Query: server_id, hours (1 to 336)
/api/v1/cache/historyResponses
200 Cache hit ratio and memory use over time. Query: server_id, hours (1 to 336)
CacheServerHistory[]namestringrequiredpointsCachePoint[]requiredCachePoint[]
bytes_servedinteger (int64)requiredevictionsinteger (int64)requiredhit_rationumber | null (double)Hit ratio since the previous sample, from 0 to 1. Null when nothing was served.
hitsinteger (int64)requiredmemory_max_bytesinteger (int64)requiredmissesinteger (int64)requiredsampled_atstring (date-time)requiredstored_bytesinteger (int64)required
server_idstring (uuid)required
Cache memory share, optional ceiling, and the cap in effect
/api/v1/cache/settingsResponses
200 Cache memory share, optional ceiling, and the cap in effect
CacheSettingsVieweffective_cap_bytesinteger (int64)requiredThe 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)required
Set how much host memory the cache may use (admin, write)
/api/v1/cache/settingsRequest bodyapplication/json
UpdateCacheSettings
memory_cap_bytesinteger | null (int64)Blank clears the extra ceiling. 16 MiB to 4 GiB.
memory_percentinteger (int32)required
Responses
200 Set how much host memory the cache may use (admin, write)
CacheSettingsVieweffective_cap_bytesinteger (int64)requiredThe 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)required
Turn caching on or off for a domain and choose its policy
/api/v1/domains/{id}/cacheRequest bodyapplication/json
UpdateDomainCache
enabledbooleanrequiredpolicy_idstring | null (uuid)Null uses the built-in "Honor origin headers" policy.
Responses
200 Turn caching on or off for a domain and choose its policy
DomainCacheViewdomain_idstring (uuid)requiredenabledbooleanrequiredhoststringrequiredpath_prefixstringrequiredpolicy_idstring | null (uuid)policy_namestring | null
Counters and usage from a server's cache
/api/v1/servers/{id}/cache/statsResponses
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)requiredhostsCacheHostStats[]requiredCacheHostStats[]
bypassinteger (int64)requiredbytes_servedinteger (int64)requiredhitsinteger (int64)requiredhoststringrequiredmissesinteger (int64)requiredobjectsinteger (int64)requiredstaleinteger (int64)requiredstored_bytesinteger (int64)required
memory_max_bytesinteger (int64)requiredobjectsinteger (int64)requiredreloadsinteger (int64)requiredrules_versioninteger (int64)requiredstored_bytesinteger (int64)requiredversionstringrequired
Cache settings and counters for a service's domains
/api/v1/services/{id}/cacheResponses
200 Cache settings and counters for a service's domains
ServiceCacheViewdomainsDomainCacheView[]requiredDomainCacheView[]
domain_idstring (uuid)requiredenabledbooleanrequiredhoststringrequiredpath_prefixstringrequiredpolicy_idstring | null (uuid)policy_namestring | null
statsCacheHostStats[]requiredCounters for this service's cached hosts.
CacheHostStats[]
bypassinteger (int64)requiredbytes_servedinteger (int64)requiredhitsinteger (int64)requiredhoststringrequiredmissesinteger (int64)requiredobjectsinteger (int64)requiredstaleinteger (int64)requiredstored_bytesinteger (int64)required
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/purgeRequest bodyapplication/json
ServiceCachePurge
allboolean | nulldomain_idstring | null (uuid)Limit the purge to one domain. Defaults to every cached domain of the service.
pathsstring[]prefixstring | null
Responses
200 Purge cached objects for a service's domains
CachePurgeResultremovedinteger (int64)required