Tuesday, August 28, 2018

Re: Customise Session Engine to distribute session data storage

Actually, there's nothing stopping you from using redis for cache and session cache.  

SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

will use your cache to store sessions.  and if you use cached_db instead of cache, that data will persist in redis and survive restarts.

On Tuesday, August 28, 2018 at 1:40:38 AM UTC-4, Web Architect wrote:
Hi Jason,

Thanks for the response. Why not use Django's cache backend and setting cache alias to be redis?

Thanks. 

On Monday, August 27, 2018 at 5:01:08 PM UTC+5:30, Jason wrote:
there's an option to use redis as a session backend, which would be faster than using a regular db, even a well tuned mysql/postgres instance

https://github.com/martinrusev/django-redis-sessions

On Monday, August 27, 2018 at 3:52:06 AM UTC-4, Web Architect wrote:
Hi,

Right now we are using the Django cache_db session engine for persistent sessions and also for some speed. Is it possible to customise this where I can store some session data in cache and some in DB? For example, I want to store all login sessions in DB and rest like some user specific data - basket etc in cache .

Looking forward to your support....

Thanks. 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/51a4dbf4-ad4c-45d7-91e4-3f51374a6807%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment