chibisov / drf-extensions

DRF-extensions is a collection of custom extensions for Django REST Framework
http://chibisov.github.io/drf-extensions/docs
MIT License
1.47k stars 208 forks source link

caching function based views #102

Open a1Gupta opened 9 years ago

a1Gupta commented 9 years ago

From the docs - "DRF-extensions allows you to cache api responses with simple @cache_response decorator. There are two requirements for decorated method: It should be method of class which is inherited from rest_framework.views.APIView It should return rest_framework.response.Response instance."

Are there any plans to include caching for function based views in drf-extensions? Function based views are comparatively faster than CBV.So, I am using FBV and I want to cache their APIs and then invalidate when any relevant model is changed.

chibisov commented 9 years ago

I don't have plans for making @cache_response compatible with FBV. If you want it you could make a pull request with this functionality.