Django REST Framework - how to do Token Authentication with Memcached

52 views
Skip to first unread message

som ghosh

unread,
Jun 30, 2015, 1:31:16 PM6/30/15
to django-res...@googlegroups.com
I am using TokenAuthentication for several of my DRF views. The view code itself have optimized logic for to use memcached if the key exists in the cache - to speed up by reducing DB queries. However, I see that for each of the API requests from phone(client), the server still does one query at least - `Postgres authtoken_token select` for validating user for the authtoken sent

Is there a way to avoid this, since the authtoken is rarely changed - by keeping it in the cache?

I am using the following in settings.py, but I don't think this is helping my case

    SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"

Reply all
Reply to author
Forward
0 new messages