Opened 4 years ago
Last modified 4 years ago
#32850 closed Cleanup/optimization
Sitemap.items() gets called several times: Fix or document? — at Initial Version
Description ¶
The Sitemap.items() method gets called several times.
This is confusing and might waste computation resources.
`
def _urls(self, page, protocol, domain):
urls = []
latest_lastmod = None
all_items_lastmod = True # track if all items have a lastmod
for item in self.paginator.page(page).object_list:
loc = "%s://%s%s" % (protocol, domain, self.get('location', item))
....
`
I see two options now:
Option1: Document this behaviour.
Option2: make paginator a cached_property.
Note:
See TracTickets
for help on using tickets.