AshCache.Info (AshCache v0.1.0)

Copy Markdown View Source

Read a resource's cache do ... end configuration.

Spark.InfoGenerator supplies cache_store/1 (returning {:ok, value} or :error), cache_store!/1, and cache/1, which lists the section's AshCache.CachedRead, AshCache.CachedAction and AshCache.Refresh entities.

Summary

Functions

cache DSL entities

Other resources whose create, update or destroy also clears this resource's cached reads and generic actions, e.g. clear_when_changed [MyApp.Blog.Comment]. Each one must use the AshCache.Resource extension, even if it caches nothing itself.

Other resources whose create, update or destroy also clears this resource's cached reads and generic actions, e.g. clear_when_changed [MyApp.Blog.Comment]. Each one must use the AshCache.Resource extension, even if it caches nothing itself.

cache DSL options

Name of the cache store. Distinct stores isolate eviction and clearing. With AshCache.Store.Adapters.Nebulex, the Nebulex cache module.

Name of the cache store. Distinct stores isolate eviction and clearing. With AshCache.Store.Adapters.Nebulex, the Nebulex cache module.

Milliseconds a cached entry lives before it expires, for every read, action and calculation that does not set its own ttl. :infinity never expires; it is never the default.

Milliseconds a cached entry lives before it expires, for every read, action and calculation that does not set its own ttl. :infinity never expires; it is never the default.

Whether the resource has AshCache configured at all.

Functions

cache(dsl_or_extended)

@spec cache(dsl_or_extended :: module() | map()) :: [struct()]

cache DSL entities

cache_clear_when_changed(dsl_or_extended)

@spec cache_clear_when_changed(dsl_or_extended :: module() | map()) ::
  {:ok, [atom()]} | :error

Other resources whose create, update or destroy also clears this resource's cached reads and generic actions, e.g. clear_when_changed [MyApp.Blog.Comment]. Each one must use the AshCache.Resource extension, even if it caches nothing itself.

cache_clear_when_changed!(dsl_or_extended)

@spec cache_clear_when_changed!(dsl_or_extended :: module() | map()) ::
  [atom()] | no_return()

Other resources whose create, update or destroy also clears this resource's cached reads and generic actions, e.g. clear_when_changed [MyApp.Blog.Comment]. Each one must use the AshCache.Resource extension, even if it caches nothing itself.

cache_options(dsl_or_extended)

@spec cache_options(dsl_or_extended :: module() | map()) :: %{
  required(atom()) => any()
}

cache DSL options

Returns a map containing the and any configured or default values.

cache_store(dsl_or_extended)

@spec cache_store(dsl_or_extended :: module() | map()) :: {:ok, atom()} | :error

Name of the cache store. Distinct stores isolate eviction and clearing. With AshCache.Store.Adapters.Nebulex, the Nebulex cache module.

cache_store!(dsl_or_extended)

@spec cache_store!(dsl_or_extended :: module() | map()) :: atom() | no_return()

Name of the cache store. Distinct stores isolate eviction and clearing. With AshCache.Store.Adapters.Nebulex, the Nebulex cache module.

cache_ttl(dsl_or_extended)

@spec cache_ttl(dsl_or_extended :: module() | map()) ::
  {:ok, pos_integer() | :infinity} | :error

Milliseconds a cached entry lives before it expires, for every read, action and calculation that does not set its own ttl. :infinity never expires; it is never the default.

cache_ttl!(dsl_or_extended)

@spec cache_ttl!(dsl_or_extended :: module() | map()) ::
  (pos_integer() | :infinity) | no_return()

Milliseconds a cached entry lives before it expires, for every read, action and calculation that does not set its own ttl. :infinity never expires; it is never the default.

cached?(resource)

@spec cached?(module()) :: boolean()

Whether the resource has AshCache configured at all.