I would like to implement a decorator that provides per-request caching to any method, not just views. Here is an example use case.
I have a custom ta
You can always do the caching manually.
...
if "get_favorites" in request.POST:
favorites = request.POST["get_favorites"]
else:
from django.core.cache import cache
favorites = cache.get(request.user.username)
if not favorites:
favorites = get_favorites(request.user)
cache.set(request.user.username, favorites, seconds)
...