﻿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
26073	Last-Modified http header not set to the latest last-mod in multi-maps sitemaps	Eric	Eric	"at [https://github.com/django/django/blob/master/django/contrib/sitemaps/views.py#L46]
{{{
def sitemap(request, sitemaps, section=None,
            template_name='sitemap.xml', content_type='application/xml'):

    req_protocol = request.scheme
    req_site = get_current_site(request)

    if section is not None:
        if section not in sitemaps:
            raise Http404(""No sitemap available for section: %r"" % section)
        maps = [sitemaps[section]]
    else:
        maps = sitemaps.values()
    page = request.GET.get(""p"", 1)

    urls = []
    for site in maps:
        try:
            if callable(site):
                site = site()
            urls.extend(site.get_urls(page=page, site=req_site,
                                      protocol=req_protocol))
        except EmptyPage:
            raise Http404(""Page %s empty"" % page)
        except PageNotAnInteger:
            raise Http404(""No page '%s'"" % page)
    response = TemplateResponse(request, template_name, {'urlset': urls},
                                content_type=content_type)
    if hasattr(site, 'latest_lastmod'):
        # if latest_lastmod is defined for site, set header so as
        # ConditionalGetMiddleware is able to send 304 NOT MODIFIED
        lastmod = site.latest_lastmod
        response['Last-Modified'] = http_date(
            timegm(
                lastmod.utctimetuple() if isinstance(lastmod, datetime.datetime)
                else lastmod.timetuple()
            )
        )
    return response
}}}

we can see that when it gets the ''''latest_lastmod'''' from '''site''' it only really depends on which was the last '''site''' in '''maps''' which might not always be the latest_lastmod from all items in maps.

I think this is a big SEO issue for websites that rely on their sitemaps being indexed by search engines as I noticed my website did not seem to have my newer Urls indexed by google since it probably saw the '''Last-Modified''' http header was not being newer that what they currently had (even if it contains new urls with newer last-mod)"	Bug	closed	contrib.sitemaps	1.9	Normal	duplicate	sitemap last-mod Last-Modified		Unreviewed	0	0	0	0	1	0
