Vary cache on token-based authentication

29 views
Skip to first unread message

Ben Tesch

unread,
Jul 1, 2019, 5:28:46 PM7/1/19
to Django REST framework
I'm hoping to find a solution to what this issue (https://github.com/encode/django-rest-framework/issues/5225) was brought up about. I can add vary_on_cookie decorator for web-based requests, but in a purely API or mobile app scenario, I would like to add a token to the authorization header and have the response be cached just for that user... otherwise obviously it would return the results in the cache, which could be someone else's data. Is a vary cache using TokenAuthentication possible?





Reply all
Reply to author
Forward
0 new messages