class
Components::Cache::RedisCacheStore
Overview
Redis-backed cache store implementation
NOTE This is a placeholder implementation until Redis shard is added
Defined in:
components/cache/redis_cache_store.crConstructors
Instance Method Summary
-
#clear : Nil
Clear all cached values
-
#delete(key : String) : Nil
Delete a value from cache
-
#exists?(key : String) : Bool
Check if a key exists
-
#fetch(key : String, expires_in : Time::Span | Nil = nil, &block : -> String) : String
Fetch a value from cache, or compute and store it if not present
-
#read(key : String) : String | Nil
Read a value from cache
-
#stats : Hash(String, Int32 | Int64)
Get statistics about the cache
-
#write(key : String, value : String, expires_in : Time::Span | Nil = nil) : Nil
Write a value to cache
Instance methods inherited from class Components::Cache::CacheStore
clear : Nil
clear,
delete(key : String) : Nil
delete,
exists?(key : String) : Bool
exists?,
fetch(key : String, expires_in : Time::Span | Nil = nil, &block : -> String) : String
fetch,
read(key : String) : String | Nil
read,
stats : Hash(String, Int32 | Int64)
stats,
write(key : String, value : String, expires_in : Time::Span | Nil = nil) : Nil
write
Constructor Detail
Instance Method Detail
def clear : Nil
#
Description copied from class Components::Cache::CacheStore
Clear all cached values
def delete(key : String) : Nil
#
Description copied from class Components::Cache::CacheStore
Delete a value from cache
def exists?(key : String) : Bool
#
Description copied from class Components::Cache::CacheStore
Check if a key exists
def fetch(key : String, expires_in : Time::Span | Nil = nil, &block : -> String) : String
#
Description copied from class Components::Cache::CacheStore
Fetch a value from cache, or compute and store it if not present
def read(key : String) : String | Nil
#
Description copied from class Components::Cache::CacheStore
Read a value from cache
def stats : Hash(String, Int32 | Int64)
#
Description copied from class Components::Cache::CacheStore
Get statistics about the cache
def write(key : String, value : String, expires_in : Time::Span | Nil = nil) : Nil
#
Description copied from class Components::Cache::CacheStore
Write a value to cache