From c363843f720100f203c77e1ffd4b6b0b3eeb059a Mon Sep 17 00:00:00 2001 From: Marco Roth Date: Sun, 15 Dec 2024 09:47:50 +0100 Subject: [PATCH] Remove `hiredis` recommendation in docs --- docs/appendices/deployment.md | 8 ++------ docs/appendices/testing.md | 8 +++++--- docs/guide/persistence.md | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/appendices/deployment.md b/docs/appendices/deployment.md index defe793a..7361a808 100644 --- a/docs/appendices/deployment.md +++ b/docs/appendices/deployment.md @@ -16,12 +16,11 @@ Instead, we make the best of things by enabling caching in the development envir ### Use Redis as your cache store -We want to change the cache store to make use of Redis. First we should enable the `redis` gem, as well as `hiredis`, a native wrapper which is much faster than the Ruby gem alone. +We want to change the cache store to make use of Redis. First we should enable the `redis` gem. ::: code-group ```ruby [Gemfile] -gem "redis", ">= 4.0", require: ["redis", "redis/connection/hiredis"] -gem "hiredis" +gem "redis", ">= 4.0", require: ["redis"] ``` ::: @@ -30,7 +29,6 @@ Now that Redis is available to your application, you need to configure your deve ::: code-group ```ruby [config/environments/development.rb] config.cache_store = :redis_cache_store, { - driver: :hiredis, url: ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } } @@ -71,7 +69,6 @@ Install the `redis-session-store` gem into your project, and then in your `produ ::: code-group ```ruby [config/environments/production.rb] config.cache_store = :redis_cache_store, { - driver: :hiredis, url: ENV.fetch("REDIS_URL") } @@ -80,7 +77,6 @@ config.session_store( key: "_session_production", serializer: :json, redis: { - driver: :hiredis, expire_after: 1.year, ttl: 1.year, key_prefix: "app:session:", diff --git a/docs/appendices/testing.md b/docs/appendices/testing.md index f434dbbc..8e21ba40 100644 --- a/docs/appendices/testing.md +++ b/docs/appendices/testing.md @@ -20,8 +20,7 @@ Install [Redis](https://redis.io/download). Make sure that it's running and acce ::: code-group ```ruby [Gemfile] -gem "redis", ">= 4.0", :require => ["redis", "redis/connection/hiredis"] -gem "hiredis" +gem "redis", ">= 4.0", require: ["redis"] ``` ::: @@ -47,7 +46,10 @@ Configure your cache store and turn on ActionController caching: ::: code-group ```ruby [config/environments/test.rb] config.action_controller.perform_caching = true -config.cache_store = :redis_cache_store, {driver: :hiredis, url: Rails.application.credentials.redis_url} + +config.cache_store = :redis_cache_store, { + url: Rails.application.credentials.redis_url +} ``` ::: diff --git a/docs/guide/persistence.md b/docs/guide/persistence.md index 69a65ccf..f4cf612f 100644 --- a/docs/guide/persistence.md +++ b/docs/guide/persistence.md @@ -187,7 +187,7 @@ The Reflex class makes use of the `session.id`, the `data-id` attributes from in If Redis is your Rails cache store, you're already one step ahead! -Depending on your application and the kind of data you're working with, [calling the Redis engine directly](/appendices/deployment#use-redis-as-your-cache-store) (through the `redis` gem, in tandem with the `hiredis` gem for optimal performance) from your Reflex methods allows you to work with the full suite of data structure manipulation tools that are available in response to the state change operations your users initiate. +Depending on your application and the kind of data you're working with, [calling the Redis engine directly](/appendices/deployment#use-redis-as-your-cache-store) (through the `redis` gem) from your Reflex methods allows you to work with the full suite of data structure manipulation tools that are available in response to the state change operations your users initiate. Using Redis is beyond the scope of this document, but an excellent starting point is Jesus Castello's excellent "[How to Use the Redis Database in Ruby](https://www.rubyguides.com/2019/04/ruby-redis)".