AshCache.Changes.InvalidateCache (AshCache v0.1.0)

Copy Markdown View Source

Invalidates a resource's cached reads after a successful write by bumping the resource's cache version (see AshCache.CacheVersion).

The bump runs in after_transaction, never after_action: a write that rolls back must leave the cache untouched, and reads running concurrently with the transaction keep caching under the old cache version — harmless, because the bump after commit makes those entries unreachable.