#24736: Replace magic 50000 Sitemap item limit with customizable value
----------------------------------+---------------------
     Reporter:  Miserlou          |      Owner:  nobody
         Type:  New feature       |     Status:  new
    Component:  contrib.sitemaps  |    Version:  1.8
     Severity:  Normal            |   Keywords:  sitemap
 Triage Stage:  Unreviewed        |  Has patch:  0
Easy pickings:  1                 |      UI/UX:  0
----------------------------------+---------------------
 Hey all!

 I recently ran into an interesting and reasonably soluble problem. I've
 switched from using a static sitemap to Django's Sitemap framework. Now,
 my database has a ton of items to map (>200,000), so generating the
 sitemap actually takes quite a long time. Unfortunately, it takes such a
 long time that my web server actually times out waiting for the request,
 which is obviously a big problem.

 Rather than deal with adding exceptions in my web server or manually
 creating static sitemaps, I'd greatly prefer to lower the number of items
 on each page and have a larger number of entries on the index page.

 Currently, the pagination uses a magic number of 50000, which is the
 maximum number of items recommended by Google. That line is here:
 
https://github.com/django/django/blob/c2d5f2903cfaef4f8b17d86f4db706b61073a471/django/contrib/sitemaps/__init__.py#L50

 I'd greatly prefer it if this was available as a configurable setting.

 This would be a very simple, 2-line fix:

 One to add a

 SITEMAP_MAX_ITEMS = 50000

 to Django's default settings,and another change the line linked about to

 limit = settings.SITEMAP_MAX_ITEMS

 It's a small change, but this would be greatly useful to me and other
 Django sites with lots of items that use the Sitemap framework. In the
 meantime, I'm just going try to override default Sitemap object.

 What do you guys think? Does this make sense to you?

--
Ticket URL: <https://code.djangoproject.com/ticket/24736>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.cb43c01fc6f914c6ac075604889bf48d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to