﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34713	Add an option to disable lastmod in Sitemaps.	Christoph Krybus	nobody	"In django 4.1+ <lastmod> was added to sitemap index (https://code.djangoproject.com/ticket/25916)

One consequence of this is that django loads now the whole queryset into memory in order to determine the lastmod value for each sitemap entry in the sitemap index. In django versions < 4.1 this was not the case, the paginator just needed to know the number of elements to generate links to the sitemaps.

My sitemap has ~1.5M entries, it worked OK in django 4.0, in django 4.1 the VM comes to a standstill.

There seem to be no way to disable this new feature without also disabling lastmod on single entries. As a workaround I'm overriding the whole view right now.

For the vast majority of sites the worse performance should not be a problem, but maybe there could be a setting or at least an overridable parameter to disable it?

The index view https://github.com/django/django/blob/4.2.3/django/contrib/sitemaps/views.py#L65 has already a variable called all_indexes_lastmod maybe it could be initialized by a new index view argument? Something like `enable_index_lastmod=True`."	Cleanup/optimization	closed	contrib.sitemaps	dev	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
