Skip to content
Dymini Panel
v0.19.1
Menu

Cache

On this page

HTTP cache policies, purge, and stats

List cache policies with their rules

GET/api/v1/cache-policies

Responses

  • 200 List cache policies with their rulesCachePolicyView[]
    • created_atstring (date-time)required
    • descriptionstringrequired
    • disk_max_bytesinteger | null (int64)

      Share of the server's disk store. Null or all-null policies keep objects in memory only.

    • domainsinteger (int64)required

      Domains that use this policy.

    • idstring (uuid)required
    • max_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).

    • namestringrequired
    • rulesCacheRule[]required
      CacheRule[]
      • actionRuleActionrequired
        RuleAction
        • bypass_cookiesstring[]

          With cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.

        • cache_cookiesboolean

          Look up and store requests that carry a Cookie header. Off by default: any request with a cookie skips the cache.

        • ignore_queryboolean

          Drop 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_originboolean

          Use s-maxage/max-age from the origin when present, and honor no-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_origin is false.

      • matchRuleMatch

        Every 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

POST/api/v1/cache-policies

Request bodyapplication/json

SaveCachePolicy

  • descriptionstring | null
  • disk_max_bytesinteger | null (int64)
  • max_object_bytesinteger | null (int64)
  • memory_max_bytesinteger | null (int64)
  • namestringrequired
  • presetstring | null

    Preset slug to start from when creating.

  • rulesCacheRule[]

    Ordered rules; the first match wins. Defaults to the preset's rules on create.

    CacheRule[]
    • actionRuleActionrequired
      RuleAction
      • bypass_cookiesstring[]

        With cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.

      • cache_cookiesboolean

        Look up and store requests that carry a Cookie header. Off by default: any request with a cookie skips the cache.

      • ignore_queryboolean

        Drop 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_originboolean

        Use s-maxage/max-age from the origin when present, and honor no-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_origin is false.

    • matchRuleMatch

      Every 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 presetCachePolicyView
    • created_atstring (date-time)required
    • descriptionstringrequired
    • disk_max_bytesinteger | null (int64)

      Share of the server's disk store. Null or all-null policies keep objects in memory only.

    • domainsinteger (int64)required

      Domains that use this policy.

    • idstring (uuid)required
    • max_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).

    • namestringrequired
    • rulesCacheRule[]required
      CacheRule[]
      • actionRuleActionrequired
        RuleAction
        • bypass_cookiesstring[]

          With cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.

        • cache_cookiesboolean

          Look up and store requests that carry a Cookie header. Off by default: any request with a cookie skips the cache.

        • ignore_queryboolean

          Drop 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_originboolean

          Use s-maxage/max-age from the origin when present, and honor no-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_origin is false.

      • matchRuleMatch

        Every 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

GET/api/v1/cache-policies/{id}

Responses

  • 200 One cache policyCachePolicyView
    • created_atstring (date-time)required
    • descriptionstringrequired
    • disk_max_bytesinteger | null (int64)

      Share of the server's disk store. Null or all-null policies keep objects in memory only.

    • domainsinteger (int64)required

      Domains that use this policy.

    • idstring (uuid)required
    • max_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).

    • namestringrequired
    • rulesCacheRule[]required
      CacheRule[]
      • actionRuleActionrequired
        RuleAction
        • bypass_cookiesstring[]

          With cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.

        • cache_cookiesboolean

          Look up and store requests that carry a Cookie header. Off by default: any request with a cookie skips the cache.

        • ignore_queryboolean

          Drop 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_originboolean

          Use s-maxage/max-age from the origin when present, and honor no-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_origin is false.

      • matchRuleMatch

        Every 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

PUT/api/v1/cache-policies/{id}

Request bodyapplication/json

SaveCachePolicy

  • descriptionstring | null
  • disk_max_bytesinteger | null (int64)
  • max_object_bytesinteger | null (int64)
  • memory_max_bytesinteger | null (int64)
  • namestringrequired
  • presetstring | null

    Preset slug to start from when creating.

  • rulesCacheRule[]

    Ordered rules; the first match wins. Defaults to the preset's rules on create.

    CacheRule[]
    • actionRuleActionrequired
      RuleAction
      • bypass_cookiesstring[]

        With cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.

      • cache_cookiesboolean

        Look up and store requests that carry a Cookie header. Off by default: any request with a cookie skips the cache.

      • ignore_queryboolean

        Drop 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_originboolean

        Use s-maxage/max-age from the origin when present, and honor no-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_origin is false.

    • matchRuleMatch

      Every 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 itCachePolicyView
    • created_atstring (date-time)required
    • descriptionstringrequired
    • disk_max_bytesinteger | null (int64)

      Share of the server's disk store. Null or all-null policies keep objects in memory only.

    • domainsinteger (int64)required

      Domains that use this policy.

    • idstring (uuid)required
    • max_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).

    • namestringrequired
    • rulesCacheRule[]required
      CacheRule[]
      • actionRuleActionrequired
        RuleAction
        • bypass_cookiesstring[]

          With cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.

        • cache_cookiesboolean

          Look up and store requests that carry a Cookie header. Off by default: any request with a cookie skips the cache.

        • ignore_queryboolean

          Drop 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_originboolean

          Use s-maxage/max-age from the origin when present, and honor no-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_origin is false.

      • matchRuleMatch

        Every 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

DELETE/api/v1/cache-policies/{id}

Responses

  • 204 Delete a cache policy; domains fall back to the default policy

Built-in policy presets

GET/api/v1/cache-presets

Responses

  • 200 Built-in policy presetsCachePresetView[]
    • descriptionstringrequired
    • namestringrequired
    • rulesCacheRule[]required
      CacheRule[]
      • actionRuleActionrequired
        RuleAction
        • bypass_cookiesstring[]

          With cache_cookies, requests carrying a cookie whose name starts with one of these still skip the cache.

        • cache_cookiesboolean

          Look up and store requests that carry a Cookie header. Off by default: any request with a cookie skips the cache.

        • ignore_queryboolean

          Drop 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_originboolean

          Use s-maxage/max-age from the origin when present, and honor no-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_origin is false.

      • matchRuleMatch

        Every 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)

GET/api/v1/cache/history

Responses

  • 200 Cache hit ratio and memory use over time. Query: server_id, hours (1 to 336)CacheServerHistory[]
    • namestringrequired
    • pointsCachePoint[]required
      CachePoint[]
      • bytes_servedinteger (int64)required
      • evictionsinteger (int64)required
      • hit_rationumber | null (double)

        Hit ratio since the previous sample, from 0 to 1. Null when nothing was served.

      • hitsinteger (int64)required
      • memory_max_bytesinteger (int64)required
      • missesinteger (int64)required
      • sampled_atstring (date-time)required
      • stored_bytesinteger (int64)required
    • server_idstring (uuid)required

Cache memory share, optional ceiling, and the cap in effect

GET/api/v1/cache/settings

Responses

  • 200 Cache memory share, optional ceiling, and the cap in effectCacheSettingsView
    • effective_cap_bytesinteger (int64)required

      The 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)

PUT/api/v1/cache/settings

Request 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)CacheSettingsView
    • effective_cap_bytesinteger (int64)required

      The 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

PUT/api/v1/domains/{id}/cache

Request bodyapplication/json

UpdateDomainCache

  • enabledbooleanrequired
  • policy_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 policyDomainCacheView
    • domain_idstring (uuid)required
    • enabledbooleanrequired
    • hoststringrequired
    • path_prefixstringrequired
    • policy_idstring | null (uuid)
    • policy_namestring | null

Counters and usage from a server's cache

GET/api/v1/servers/{id}/cache/stats

Responses

  • 200 Counters and usage from a server's cacheCacheStats
    • disk_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)required
    • hostsCacheHostStats[]required
      CacheHostStats[]
      • bypassinteger (int64)required
      • bytes_servedinteger (int64)required
      • hitsinteger (int64)required
      • hoststringrequired
      • missesinteger (int64)required
      • objectsinteger (int64)required
      • staleinteger (int64)required
      • stored_bytesinteger (int64)required
    • memory_max_bytesinteger (int64)required
    • objectsinteger (int64)required
    • reloadsinteger (int64)required
    • rules_versioninteger (int64)required
    • stored_bytesinteger (int64)required
    • versionstringrequired

Cache settings and counters for a service's domains

GET/api/v1/services/{id}/cache

Responses

  • 200 Cache settings and counters for a service's domainsServiceCacheView
    • domainsDomainCacheView[]required
      DomainCacheView[]
      • domain_idstring (uuid)required
      • enabledbooleanrequired
      • hoststringrequired
      • path_prefixstringrequired
      • policy_idstring | null (uuid)
      • policy_namestring | null
    • statsCacheHostStats[]required

      Counters for this service's cached hosts.

      CacheHostStats[]
      • bypassinteger (int64)required
      • bytes_servedinteger (int64)required
      • hitsinteger (int64)required
      • hoststringrequired
      • missesinteger (int64)required
      • objectsinteger (int64)required
      • staleinteger (int64)required
      • stored_bytesinteger (int64)required
    • stats_errorstring | null

      Why stats are missing, such as an unreachable cache server.

Purge cached objects for a service's domains

POST/api/v1/services/{id}/cache/purge

Request bodyapplication/json

ServiceCachePurge

  • allboolean | null
  • domain_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 domainsCachePurgeResult
    • removedinteger (int64)required