From 30bfa4b13980658f073decb9a9bd06a2263a4d90 Mon Sep 17 00:00:00 2001 From: Abderrahmane Smimite Date: Sat, 21 Sep 2024 10:42:44 +0200 Subject: [PATCH] For analytics speed --- backend/core/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/core/views.py b/backend/core/views.py index f35692ba9..08d9dbc5f 100644 --- a/backend/core/views.py +++ b/backend/core/views.py @@ -1723,6 +1723,8 @@ def quality_check(self, request): ] return Response({"results": res}) + @method_decorator(cache_page(60 * SHORT_CACHE_TTL)) + @method_decorator(vary_on_cookie) @action(detail=True, methods=["get"]) def global_score(self, request, pk): """Returns the global score of the compliance assessment""" @@ -1820,6 +1822,8 @@ def export(self, request, pk): else: return Response({"error": "Permission denied"}) + @method_decorator(cache_page(60 * SHORT_CACHE_TTL)) + @method_decorator(vary_on_cookie) @action(detail=True, methods=["get"]) def donut_data(self, request, pk): compliance_assessment = ComplianceAssessment.objects.get(id=pk)