class Azu::Cache::Manager

Overview

Main cache interface

Defined in:

azu/cache.cr

Constructors

Instance Method Summary

Constructor Detail

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

[View source]

Instance Method Detail

def clear : Bool #

[View source]
def config : Configuration #

[View source]
def decrement(key : String, amount : Int32 = 1, ttl : Time::Span | Nil = nil) : Int32 | Nil #

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

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

[View source]
def fetch(key : String, ttl : Time::Span | Nil = nil, & : -> String) : String #

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

Rails-like API methods with optional performance metrics


[View source]
def get(key : String, ttl : Time::Span | Nil = nil, & : -> String) : String #

Overloaded get method with block and TTL support (Rails-like)


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

Multi-key operations


[View source]
def increment(key : String, amount : Int32 = 1, ttl : Time::Span | Nil = nil) : Int32 | Nil #

Counter operations


[View source]
def ping : String | Nil #

Redis-specific methods (only available when using Redis store)


[View source]
def redis_info : Hash(String, String) | Nil #

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

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

[View source]
def size : Int32 #

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

Utility methods


[View source]
def store : Store #

[View source]