Cache
type for easily interacting with common caching backends.
Service
and can be configured like other Alchemy services with the config
function. Out of the box, providers are provided for Redis and SQL based caches as well as an in memory mock cache.
Cache.sql()
cache configuration, you’ll need to add the Cache.AddCacheMigration
migration to your database’s migrations.
set()
function.
CacheAllowed
in a cache. Out of the box, Bool
, String
, Int
, and Double
are supported, but you can easily store your own types as well.
get()
.
has()
.
increment()
and decrement()
.
delete()
to clear an item from the cache.
remove()
, you can clear and return a cache item.
CacheProvider
protocol.