From 59860c3e37bac2381c1cdd1a7566c82314852fc1 Mon Sep 17 00:00:00 2001 From: loulous27 Date: Thu, 4 Dec 2025 16:38:42 +0100 Subject: [PATCH] Add caches to photos --- photo21/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/photo21/views.py b/photo21/views.py index 400e948..167e3d2 100644 --- a/photo21/views.py +++ b/photo21/views.py @@ -6,10 +6,12 @@ from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponse from django.views.generic import ListView, View +from django.views.decorators.cache import cache_page from photologue.models import Gallery class MediaAccess(LoginRequiredMixin, View): + @cache_page(31*24*60*60) def get(self, request, path): response = HttpResponse() # Content-type will be detected by nginx