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.cr

Constructors

Instance Method Summary

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

def self.new(prefix : String = "amber:components:") #

[View source]

Instance Method Detail

def clear : Nil #
Description copied from class Components::Cache::CacheStore

Clear all cached values


[View source]
def delete(key : String) : Nil #
Description copied from class Components::Cache::CacheStore

Delete a value from cache


[View source]
def exists?(key : String) : Bool #
Description copied from class Components::Cache::CacheStore

Check if a key exists


[View source]
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


[View source]
def read(key : String) : String | Nil #
Description copied from class Components::Cache::CacheStore

Read a value from cache


[View source]
def stats : Hash(String, Int32 | Int64) #
Description copied from class Components::Cache::CacheStore

Get statistics about the cache


[View source]
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


[View source]