class Components::Cache::Configuration

Overview

Cache configuration for the component system

Defined in:

components/cache/configuration.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def apply! : Nil #

Apply configuration to all components


[View source]
def default_expires_in : Time::Span #

Default expiration time


[View source]
def default_expires_in=(default_expires_in : Time::Span) #

Default expiration time


[View source]
def disable! : Nil #

Disable caching


[View source]
def enable! : Nil #

Enable caching


[View source]
def enabled : Bool #

Whether caching is enabled


[View source]
def enabled=(enabled : Bool) #

Whether caching is enabled


[View source]
def key_prefix : String #

Cache key prefix


[View source]
def key_prefix=(key_prefix : String) #

Cache key prefix


[View source]
def log_enabled : Bool #

Whether to log cache hits/misses


[View source]
def log_enabled=(log_enabled : Bool) #

Whether to log cache hits/misses


[View source]
def store : CacheStore | Nil #

The active cache store


[View source]
def store=(store : CacheStore | Nil) #

The active cache store


[View source]
def track_stats : Bool #

Cache statistics tracking


[View source]
def track_stats=(track_stats : Bool) #

Cache statistics tracking


[View source]
def use_custom_cache(store : CacheStore) : Nil #

Configure custom cache store


[View source]
def use_memory_cache : Nil #

Configure memory cache


[View source]
def use_redis_cache(prefix : String = @key_prefix) : Nil #

Configure Redis cache

NOTE Redis parameter will be added when Redis shard is installed


[View source]