Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

redis cache #475

Open
yisen-cai opened this issue Apr 17, 2019 · 1 comment
Open

redis cache #475

yisen-cai opened this issue Apr 17, 2019 · 1 comment

Comments

@yisen-cai
Copy link

yisen-cai commented Apr 17, 2019

I debug my django project these days, found every single request is calling authentication model query, could this too wasted.

Query authentication model one time


When I using my Spring Boot project I always store the token in Redis, because redis is faster than database, in django, request.user is useful, store an object is best, I think if there is a way to store authentication model in redis as the first login time, set it's alive time, maybe few hours, time ended, data gone, when a new request come, query from redis, I think this could get an higher performance, thanks!
And if there is chance, I want to add this code.

@jadhavmanoj
Copy link

jadhavmanoj commented Apr 27, 2019

@yisen718 you can use cacheops https://github.com/Suor/django-cacheops for storing auth model in Redis. Also, I don't think we should add code for storing auth model in the cache for this repository.

would love to hear thought on this if anyone has a suggestion or comments

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants