diff --git a/aircox/views/log.py b/aircox/views/log.py index 564e0cb..a0f8667 100644 --- a/aircox/views/log.py +++ b/aircox/views/log.py @@ -1,6 +1,8 @@ from collections import deque import datetime +from django.utils.decorators import method_decorator +from django.views.decorators.cache import cache_page from django.views.generic import ListView from django.utils import timezone as tz @@ -91,6 +93,10 @@ class LogListAPIView(LogListMixin, BaseAPIView, ListAPIView): serializer_class = LogInfoSerializer queryset = Log.objects.all() + @method_decorator(cache_page(5)) + def list(self, *args, **kwargs): + return super().list(*args, **kwargs) + def get_date(self): date = super().get_date() if date is None: