Reputation: 3015
I have set up Rails to use redis as its cache store:
config.cache_store = :redis_store
However, I have a staging environment on the same server as production and they both use the same redis instance.
How can I namespace the redis cache records by environment?
Upvotes: 6
Views: 2620
Reputation:
Add to initializers/session_store.rb
YourApp::Application.config.session_store :redis_store, servers: { namespace: 'sessions' }
Upvotes: 3
Reputation: 10018
redis-store
gem can accept namespace as the second parameter for session store. Maybe it also can accept namespace for cache store the same way?
Upvotes: 2