From a1984f60f500ae20450d1265c12f49b83fe251b2 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sun, 8 Dec 2024 22:52:50 +0100 Subject: [PATCH] Ajout de cache sur le sitemap --- src/agenda_culturel/urls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/agenda_culturel/urls.py b/src/agenda_culturel/urls.py index 02fdff1..1a8abfc 100644 --- a/src/agenda_culturel/urls.py +++ b/src/agenda_culturel/urls.py @@ -7,6 +7,7 @@ from django.views.i18n import JavaScriptCatalog from django.contrib.sitemaps.views import sitemap from django.contrib.sitemaps import GenericSitemap from .sitemaps import StaticViewSitemap +from django.views.decorators.cache import cache_page from .views import * @@ -201,7 +202,7 @@ urlpatterns = [ path("ckeditor5/", include('django_ckeditor_5.urls')), path( "sitemap.xml", - sitemap, + cache_page(86400)(sitemap), {"sitemaps": sitemaps}, name="django.contrib.sitemaps.views.sitemap", ),