redis
gem, as well as hiredis
, a native wrapper which is much faster than the Ruby gem alone.cache_store
is an accessor, while session_store
is a method. Take care not to use an =
when defining your session_store
.redis-session-store
gem.volatile-lru
key expiration strategy. It means that if your Redis instance gets full, it will start ejecting the session data for the users who have likely churned anyhow, while ensuring regular users stay logged in.volatile-lru
key expiration strategy. If your job queue runs out of space, you want it sounding every alarm possible.redis-session-store
gem into your project, and then in your production.rb
you can change your session store:hiredis
gem does not support SSL. When you provision multiple Heroku Redis addons at the "Hobby" tier, it will give you a "color URL" and a REDIS_TLS_URL . You need to use the non-TLS one which works just fine without SSL.hiredis
supports SSL, you will need to create your addon instance by specifying that Redis 5 is to be used:heroku/ruby
buildpack is required to successfully deploy a StimulusReflex app on Heroku. However, if you see the error:(WARNING: Can't locate the stimulus_reflex npm package [...])
<%= action_cable_meta_tag %>
to our HEADs.nginx.conf
has the port 443 section set up to receive secure websockets:default_url_options
for each environmentApplicationController.render()
to re-render a partial to replace existing content. It is advisable to give ActionDispatch enough information about your environment that it can pass the right values to any helpers that need to build URL paths based on the current application environment.gem "anycable-rails", "~> 1.0"
to your Gemfile
.rails g anycable:setup
after the gem has been installed.consumer.js
your browser doesn't have to re-establish a new websocket connection with the server on every page. Turbolinks allows your connection to be persisted between page loads.consumer.js
to connect to your application URL. Note that you can connect to secure websockets via SSL by usingwss://
instead of ws://