Ajout de cache sur le sitemap

This commit is contained in:
Jean-Marie Favreau 2024-12-08 22:52:50 +01:00
parent ce95fe6504
commit a1984f60f5

View File

@ -7,6 +7,7 @@ from django.views.i18n import JavaScriptCatalog
from django.contrib.sitemaps.views import sitemap from django.contrib.sitemaps.views import sitemap
from django.contrib.sitemaps import GenericSitemap from django.contrib.sitemaps import GenericSitemap
from .sitemaps import StaticViewSitemap from .sitemaps import StaticViewSitemap
from django.views.decorators.cache import cache_page
from .views import * from .views import *
@ -201,7 +202,7 @@ urlpatterns = [
path("ckeditor5/", include('django_ckeditor_5.urls')), path("ckeditor5/", include('django_ckeditor_5.urls')),
path( path(
"sitemap.xml", "sitemap.xml",
sitemap, cache_page(86400)(sitemap),
{"sitemaps": sitemaps}, {"sitemaps": sitemaps},
name="django.contrib.sitemaps.views.sitemap", name="django.contrib.sitemaps.views.sitemap",
), ),