Ticket #10793: 10793.diff

File 10793.diff, 1.8 KB (added by Grzegorz Nosek, 12 years ago)
  • django/contrib/sitemaps/__init__.py

    diff --git a/django/contrib/sitemaps/__init__.py b/django/contrib/sitemaps/__init__.py
    index 781ad89..53b375a 100644
    a b class Sitemap(object):  
    6060        return obj.get_absolute_url()
    6161
    6262    def _get_paginator(self):
    63         if not hasattr(self, "_paginator"):
    64             self._paginator = paginator.Paginator(self.items(), self.limit)
    65         return self._paginator
     63        return paginator.Paginator(self.items(), self.limit)
    6664    paginator = property(_get_paginator)
    6765
    6866    def get_urls(self, page=1, site=None, protocol=None):
  • docs/releases/1.4.txt

    diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt
    index 464ba57..530ca79 100644
    a b settings file to list all your applications explicitly.  
    11421142This attribute was confusingly named ``HttpRequest.raw_post_data``, but it
    11431143actually provided the body of the HTTP request. It's been renamed to
    11441144``HttpRequest.body``, and ``HttpRequest.raw_post_data`` has been deprecated.
     1145
     1146``django.contrib.sitemaps`` bugfix with potential performance implications
     1147~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1148
     1149Issue #10793 was caused by excessive caching of Paginator objects and resulted
     1150in stale sitemap indexes being generated. Removing this cache causes new
     1151Paginator objects to be created and the :attr:`django.contrib.sitemaps.Sitemap.items()` method of the
     1152:class:`django.contrib.sitemaps.Sitemap` subclass to be called during every
     1153sitemap-related request.
     1154
     1155If the :attr:`django.contrib.sitemaps.Sitemap.items()` method returns a ``QuerySet``, its length will be evaluated
     1156which may lead to extra database queries. Consider using the cache framework
     1157to mitigate the performance impact.
     1158 No newline at end of file
Back to Top