class CQL::Cache::RedisCache

Overview

Redis cache implementation with advanced features

Defined in:

cache/redis_cache.cr

Constructors

Instance Method Summary

Instance methods inherited from class CQL::Cache::CacheInterface

clear : Bool clear, delete(key : String) : Bool delete, delete_multi(keys : Array(String)) : Int32 delete_multi, exists?(key : String) : Bool exists?, get(key : String) : String | Nil get, get_multi(keys : Array(String)) : Hash(String, String | Nil) get_multi, get_version(key : String) : Int64 | Nil get_version, increment_version(key : String) : Int64 increment_version, invalidate_tags(tags : Array(String)) : Int32 invalidate_tags, set(key : String, value : String, ttl : Time::Span | Nil = nil) : Bool set, set_multi(data : Hash(String, String), ttl : Time::Span | Nil = nil) : Bool set_multi, size : Int32 size, stats : Hash(String, String | Int32 | Int64 | Float64) stats, tag_cache(key : String, tags : Array(String)) : Bool tag_cache

Constructor Detail

def self.new(config : Config = Config.new) #

[View source]
def self.new(url : String, key_prefix : String = "cql") #

[View source]

Instance Method Detail

def clear : Bool #

[View source]
def connection_info : String #

Get Redis connection info


[View source]
def delete(key : String) : Bool #

[View source]
def delete_multi(keys : Array(String)) : Int32 #

[View source]
def exists?(key : String) : Bool #

[View source]
def get(key : String) : String | Nil #

Basic cache operations


[View source]
def get_multi(keys : Array(String)) : Hash(String, String | Nil) #

Batch operations for efficiency


[View source]
def get_version(key : String) : Int64 | Nil #

Version-based invalidation support


[View source]
def increment_version(key : String) : Int64 #

[View source]
def invalidate_tags(tags : Array(String)) : Int32 #

[View source]
def ping : Bool #

Health check method


[View source]
def set(key : String, value : String, ttl : Time::Span | Nil = nil) : Bool #

[View source]
def set_multi(data : Hash(String, String), ttl : Time::Span | Nil = nil) : Bool #

[View source]
def size : Int32 #

[View source]
def stats : Hash(String, String | Int32 | Int64 | Float64) #

Statistics and monitoring


[View source]
def tag_cache(key : String, tags : Array(String)) : Bool #

Tag-based invalidation support


[View source]