Separate Redis DB for my sessions
This has two advantages:
- Sessions aren't evicted when the cache is full (with FPC for example)
- I can flush without losing customer sessions.
0
votes
AdminHypernode Dev Team
(Developer, Hypernode BV)
shared this idea
You can use multiple databases in redis with a max of 16.
-
Jeroen Boersma commented
Use:
db=2; echo 'keys *' | redis-cli -n ${db} | awk '{ print $1; }' | while read a; do if [ -n "${a}" ]; then echo "DEL "${a}; fi; done | redis-cli
Change db=1 to the used db.
Used http://stackoverflow.com/questions/8799063/in-redis-how-do-i-remove-keys as inspiration