Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session Caching Question #184

Open
john-kelly opened this issue Mar 27, 2024 · 0 comments
Open

Session Caching Question #184

john-kelly opened this issue Mar 27, 2024 · 0 comments

Comments

@john-kelly
Copy link

Hello! Thank you for this great project. I have a question about session caching similar to django's built-in cached_db.

I know this was discussed already here: #52 and I see that there is an alternative library that supports this, however, I wanted to get some clarification on a possible solution! And if it works, could maybe be added to the documentation for this library!

It seems that django-qsessions simply subclasses the built-in cached_db SessionStore, is there any reason this solution wouldnt work with your library? For example:

from django.contrib.sessions.backends.cached_db import SessionStore as DjangoCachedDBStore

from user_sessions.backends.db import SessionStore as UserSessionStore

KEY_PREFIX = "my_session_cache_prefix"

class CachedUserSessionStore(UserSessionStore, DjangoCachedDBStore):
    cache_key_prefix = KEY_PREFIX

Am I missing something obvious here? It seems to be working for me locally, however, it seemed too good to be true!

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

No branches or pull requests

1 participant