class CQL::Cache::CacheStore

Overview

Factory class for creating cache store instances

Defined in:

cache/cache_store.cr

Class Method Summary

Class Method Detail

def self.config : CacheStoreConfig | Nil #

Get current configuration


[View source]
def self.configure(config : CacheStoreConfig) #

Configure the cache store globally


[View source]
def self.configure_from_env #

Configure from environment variables


[View source]
def self.configure_from_hash(hash : Hash(String, String | Int32 | Int64 | Bool)) #

Configure from hash


[View source]
def self.create(config : CacheStoreConfig) : CacheInterface #

Create a new cache instance with specific configuration


[View source]
def self.create(type : String, key_prefix : String | Nil = nil, redis_url : String | Nil = nil, max_size : Int32 | Nil = nil, default_ttl : Time::Span | Nil = nil) : CacheInterface #

Create cache with string type for convenience


[View source]
def self.instance : CacheInterface #

Get the singleton cache instance


[View source]
def self.reset #

Reset the singleton instance (useful for testing)


[View source]