Skip to content

Commit

Permalink
Remove hiredis recommendation in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoroth committed Dec 15, 2024
1 parent 6851a63 commit c363843
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 2 additions & 6 deletions docs/appendices/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
```
:::

Expand All @@ -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" }
}

Expand Down Expand Up @@ -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")
}

Expand All @@ -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:",
Expand Down
8 changes: 5 additions & 3 deletions docs/appendices/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
```
:::

Expand All @@ -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
}
```
:::

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)".

Expand Down

0 comments on commit c363843

Please sign in to comment.