I'm trying to cache some of my DRF api calls in a CDN. I need the following headers Cache-Control:public, max-age=XXXX
This is pretty easy when you're using traditional django templating, you just add the @cache_page() @cache_control(public=True) decorators, but for DRF, I can't find anything similar. There's quite a bit about in mem caches, which I already have up, but I'd really like to get the CDN to take that load off my server all together, I'd like to cache the resulting queryset.
I'm also using modelViewSets if that matters for anything:
class EventViewSet(viewsets.ModelViewSet):
serializer_class = EventViewSet
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
pagination_class = pagination.LimitOffsetPagination
filter_backends = (filters.DjangoFilterBackend, filters.SearchFilter,)
filter_class = EventFilter
search_fields = ('name','city','state')
def get_queryset(self):