# `AshCache.Resource.Verifiers.ValidateCacheBlock`
[🔗](https://github.com/Undeadlol1/ash_cache/blob/v0.1.0/lib/ash_cache/resource/verifiers/validate_cache_block.ex#L1)

Rejects a `cache` block that names an action of the wrong type, declares
the same action twice, refreshes a read it does not cache, or lists in
`clear_when_changed` a module that is not a resource using AshCache.
A typo in any of these would silently cache or clear nothing.

Also rejects a cached generic action that returns nothing (there is nothing
to cache) or whose `run` is a Reactor (Ash runs a Reactor itself, so
AshCache cannot put itself in front of it).

A cached calculation must exist and be a module calculation with
`calculate/3`. An expression calculation is rejected: it already runs in
the database, and cached reads already hold its result.

A resource may cache nothing: it can use the extension only so its writes
clear the reads of resources that list it in `clear_when_changed`.

---

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