# `AshCache.Info`
[🔗](https://github.com/Undeadlol1/ash_cache/blob/v0.1.0/lib/ash_cache/info.ex#L1)

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.

# `cache`

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

cache DSL entities

# `cache_clear_when_changed`

```elixir
@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!`

```elixir
@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`

```elixir
@spec cache_options(dsl_or_extended :: module() | map()) :: %{
  required(atom()) =&gt; any()
}
```

cache DSL options

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

# `cache_store`

```elixir
@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!`

```elixir
@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`

```elixir
@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!`

```elixir
@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?`

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

Whether the resource has AshCache configured at all.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
