Skip to content

Commit d4025ab

Browse files
committed
Update ActiveSupport::Cache::RedisCacheStore documentation
For more info: * rails#46149 * rails#46204
1 parent 60d05cd commit d4025ab

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

guides/source/caching_with_rails.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,8 @@ is often faster than waiting more than a second to retrieve it. Both read and
507507
write timeouts default to 1 second, but may be set lower if your network is
508508
consistently low-latency.
509509

510-
By default, the cache store will not attempt to reconnect to Redis if the
511-
connection fails during a request. If you experience frequent disconnects you
512-
may wish to enable reconnect attempts.
510+
By default, the cache store will attempt to reconnect to Redis once if the
511+
connection fails during a request.
513512

514513
Cache reads and writes never raise exceptions; they just return `nil` instead,
515514
behaving as if there was nothing in the cache. To gauge whether your cache is
@@ -537,10 +536,10 @@ A more complex, production Redis cache store may look something like this:
537536
cache_servers = %w(redis://cache-01:6379/0 redis://cache-02:6379/0)
538537
config.cache_store = :redis_cache_store, { url: cache_servers,
539538

540-
connect_timeout: 30, # Defaults to 20 seconds
539+
connect_timeout: 30, # Defaults to 1 second
541540
read_timeout: 0.2, # Defaults to 1 second
542541
write_timeout: 0.2, # Defaults to 1 second
543-
reconnect_attempts: 1, # Defaults to 0
542+
reconnect_attempts: 2, # Defaults to 1
544543

545544
error_handler: -> (method:, returning:, exception:) {
546545
# Report errors to Sentry as warnings

0 commit comments

Comments
 (0)