Skip to content

Session Caching Question #184

@john-kelly

Description

@john-kelly

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions