/api/remote_version/: Cache response for 4h

This commit is contained in:
Andy Grunwald
2025-02-26 18:43:10 +01:00
parent 61cb5103ed
commit 247a2a3e82

View File

@@ -45,6 +45,7 @@ from django.utils.timezone import make_aware
from django.utils.translation import get_language from django.utils.translation import get_language
from django.views import View from django.views import View
from django.views.decorators.cache import cache_control from django.views.decorators.cache import cache_control
from django.views.decorators.cache import cache_page
from django.views.decorators.http import condition from django.views.decorators.http import condition
from django.views.decorators.http import last_modified from django.views.decorators.http import last_modified
from django.views.generic import TemplateView from django.views.generic import TemplateView
@@ -2208,6 +2209,7 @@ class UiSettingsView(GenericAPIView):
), ),
) )
class RemoteVersionView(GenericAPIView): class RemoteVersionView(GenericAPIView):
@method_decorator(cache_page(60 * 60 * 4))
def get(self, request, format=None): def get(self, request, format=None):
remote_version = "0.0.0" remote_version = "0.0.0"
is_greater_than_current = False is_greater_than_current = False