Bỏ qua, tới nội dung
Dymini Panel
v0.18.1
Mục lục
Bạn đang xem tài liệu của v0.18.1.Xem bản mới nhất

Cache

Trong trang này

HTTP cache policies, purge, and stats

List cache policies with their rules

GET/api/v1/cache-policies

Phản hồi

  • 200 List cache policies with their rulesCachePolicyView[]
    • created_atstring (date-time)bắt buộc
    • descriptionstringbắt buộc
    • disk_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ộc

      Domains that use this policy.

    • idstring (uuid)bắt buộc
    • 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).

    • namestringbắt buộc
    • rulesCacheRule[]bắt buộc
      CacheRule[]
      • actionRuleActionbắt buộc
        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)bắt buộc

Create a cache policy, optionally from a preset

POST/api/v1/cache-policies

Nội dung gửi lênapplication/json

SaveCachePolicy

  • descriptionstring | null
  • disk_max_bytesinteger | null (int64)
  • max_object_bytesinteger | null (int64)
  • memory_max_bytesinteger | null (int64)
  • namestringbắt buộc
  • 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[]
    • actionRuleActionbắt buộc
      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

Phản hồi

  • 201 Create a cache policy, optionally from a presetCachePolicyView
    • created_atstring (date-time)bắt buộc
    • descriptionstringbắt buộc
    • disk_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ộc

      Domains that use this policy.

    • idstring (uuid)bắt buộc
    • 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).

    • namestringbắt buộc
    • rulesCacheRule[]bắt buộc
      CacheRule[]
      • actionRuleActionbắt buộc
        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)bắt buộc

One cache policy

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

Phản hồi

  • 200 One cache policyCachePolicyView
    • created_atstring (date-time)bắt buộc
    • descriptionstringbắt buộc
    • disk_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ộc

      Domains that use this policy.

    • idstring (uuid)bắt buộc
    • 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).

    • namestringbắt buộc
    • rulesCacheRule[]bắt buộc
      CacheRule[]
      • actionRuleActionbắt buộc
        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)bắt buộc

Replace a cache policy and republish the servers using it

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

Nội dung gửi lênapplication/json

SaveCachePolicy

  • descriptionstring | null
  • disk_max_bytesinteger | null (int64)
  • max_object_bytesinteger | null (int64)
  • memory_max_bytesinteger | null (int64)
  • namestringbắt buộc
  • 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[]
    • actionRuleActionbắt buộc
      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

Phản hồi

  • 200 Replace a cache policy and republish the servers using itCachePolicyView
    • created_atstring (date-time)bắt buộc
    • descriptionstringbắt buộc
    • disk_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ộc

      Domains that use this policy.

    • idstring (uuid)bắt buộc
    • 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).

    • namestringbắt buộc
    • rulesCacheRule[]bắt buộc
      CacheRule[]
      • actionRuleActionbắt buộc
        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)bắt buộc

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

DELETE/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

GET/api/v1/cache-presets

Phản hồi

  • 200 Built-in policy presetsCachePresetView[]
    • descriptionstringbắt buộc
    • namestringbắt buộc
    • rulesCacheRule[]bắt buộc
      CacheRule[]
      • actionRuleActionbắt buộc
        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
    • slugstringbắt buộc

Cache hit ratio and memory use over time. Query: server_id, hours (1 to 336)

GET/api/v1/cache/history

Phản hồi

  • 200 Cache hit ratio and memory use over time. Query: server_id, hours (1 to 336)CacheServerHistory[]
    • namestringbắt buộc
    • pointsCachePoint[]bắt buộc
      CachePoint[]
      • bytes_servedinteger (int64)bắt buộc
      • evictionsinteger (int64)bắt buộc
      • hit_rationumber | null (double)

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

      • hitsinteger (int64)bắt buộc
      • memory_max_bytesinteger (int64)bắt buộc
      • missesinteger (int64)bắt buộc
      • sampled_atstring (date-time)bắt buộc
      • stored_bytesinteger (int64)bắt buộc
    • server_idstring (uuid)bắt buộc

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

GET/api/v1/cache/settings

Phản hồi

  • 200 Cache memory share, optional ceiling, and the cap in effectCacheSettingsView
    • effective_cap_bytesinteger (int64)bắt buộc

      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)bắt buộc

Set how much host memory the cache may use (admin, write)

PUT/api/v1/cache/settings

Nộ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)CacheSettingsView
    • effective_cap_bytesinteger (int64)bắt buộc

      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)bắt buộc

Turn caching on or off for a domain and choose its policy

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

Nội dung gửi lênapplication/json

UpdateDomainCache

  • enabledbooleanbắt buộc
  • policy_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 policyDomainCacheView
    • domain_idstring (uuid)bắt buộc
    • enabledbooleanbắt buộc
    • hoststringbắt buộc
    • path_prefixstringbắt buộc
    • policy_idstring | null (uuid)
    • policy_namestring | null

Counters and usage from a server's cache

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

Phản hồi

  • 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)bắt buộc
    • hostsCacheHostStats[]bắt buộc
      CacheHostStats[]
      • bypassinteger (int64)bắt buộc
      • bytes_servedinteger (int64)bắt buộc
      • hitsinteger (int64)bắt buộc
      • hoststringbắt buộc
      • missesinteger (int64)bắt buộc
      • objectsinteger (int64)bắt buộc
      • staleinteger (int64)bắt buộc
      • stored_bytesinteger (int64)bắt buộc
    • memory_max_bytesinteger (int64)bắt buộc
    • objectsinteger (int64)bắt buộc
    • reloadsinteger (int64)bắt buộc
    • rules_versioninteger (int64)bắt buộc
    • stored_bytesinteger (int64)bắt buộc
    • versionstringbắt buộc

Cache settings and counters for a service's domains

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

Phản hồi

  • 200 Cache settings and counters for a service's domainsServiceCacheView
    • domainsDomainCacheView[]bắt buộc
      DomainCacheView[]
      • domain_idstring (uuid)bắt buộc
      • enabledbooleanbắt buộc
      • hoststringbắt buộc
      • path_prefixstringbắt buộc
      • policy_idstring | null (uuid)
      • policy_namestring | null
    • statsCacheHostStats[]bắt buộc

      Counters for this service's cached hosts.

      CacheHostStats[]
      • bypassinteger (int64)bắt buộc
      • bytes_servedinteger (int64)bắt buộc
      • hitsinteger (int64)bắt buộc
      • hoststringbắt buộc
      • missesinteger (int64)bắt buộc
      • objectsinteger (int64)bắt buộc
      • staleinteger (int64)bắt buộc
      • stored_bytesinteger (int64)bắt buộc
    • 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

Nội dung gửi lênapplication/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

Phản hồi

  • 200 Purge cached objects for a service's domainsCachePurgeResult
    • removedinteger (int64)bắt buộc