class RedisCacheStore
Ruby on Rails 5.2.8.1
Since v5.2.8.1Redis cache store.
Deployment note: Take care to use a *dedicated Redis cache* rather than pointing this at your existing Redis server. It won’t cope well with mixed usage patterns and it won’t expire cache entries by default.
Redis cache server setup guide: redis.io/topics/lru-cache
-
Supports vanilla Redis, hiredis, and Redis::Distributed.
-
Supports Memcached-like sharding across Redises with Redis::Distributed.
-
Fault tolerant. If the Redis server is unavailable, no exceptions are raised. Cache fetches are all misses and writes are dropped.
-
Local cache. Hot in-memory primary cache within block/middleware scope.
-
read_multiandwrite_multisupport for Redis mget/mset. Use Redis::Distributed 4.0.1+ for distributed mget support. -
delete_matchedsupport for Redis KEYS globs.
Inherits from
Constants
Attributes
Methods (defined here)
- # cleanup
- # clear
- # decrement
- # delete_matched
- # increment
- # inspect
- # read_multi
- # redis
- self. new
Private methods
(16)
Implementation detail — not part of the public API.
- # delete_entry
- # deserialize_entry
- # failsafe
- # handle_exception
- # normalize_key
- # read_entry
- # read_multi_entries
- # read_multi_mget
- # serialize_entries
- # serialize_entry
- # set_redis_capabilities
- # truncate_key
- # write_entry
- # write_multi_entries
- self. build_redis_client
- self. build_redis_distributed_client
Methods (inherited)
From ActiveSupport::Cache::Store (16)
- # cleanup
- # clear
- # decrement
- # delete
- # delete_matched
- # exist?
- # fetch
- # fetch_multi
- # increment
- # mute
- # read
- # read_multi
- # silence!
- # write
- # write_multi
- self. new
From Object (17)
- # acts_like?
- # blank?
- # deep_dup
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_param
- # to_query
- # try
- # try!
- # unescape
- # with_options