Opened 8 years ago

Closed 8 years ago

#3766 closed (fixed)

[patch] django.contrib.sites should cache to reduce queries like contenttypes does

Reported by: David Cramer <dcramer@…> Owned by: nobody
Component: Contrib apps Version: master
Severity: Keywords: sites
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

As you did with the CONTENT_TYPE_CACHE I would suggest the same be applied with the django.contrib.sites app so that multiple calls to get current (and similar) are not extra queries

Attachments (3)

site_cache.diff (1.5 KB) - added by Matt Riggott 8 years ago.
Patch to add Site object caching to django.contrib.sites.models.SiteManager
sites_docs.diff (1.3 KB) - added by Matt Riggott 8 years ago.
Documentation on the caching and the Site.objects.clear_cache() method.
sites_docs.2.diff (1.3 KB) - added by Matt Riggott 8 years ago.
Formatting changes to the docs diff: lines wrapped at 80 characters and a "New in Django development version" notice added.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by Simon G. <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from Site Caching to django.contrib.sites should cache to reduce queries like contenttypes does
  • Triage Stage changed from Unreviewed to Accepted

Where CONTENT_TYPE_CACHE is that which is implemented in django.contrib.contenttypes.models

Changed 8 years ago by Matt Riggott

Patch to add Site object caching to django.contrib.sites.models.SiteManager

comment:2 Changed 8 years ago by Matt Riggott

  • Has patch set
  • Summary changed from django.contrib.sites should cache to reduce queries like contenttypes does to [patch] django.contrib.sites should cache to reduce queries like contenttypes does

Changed 8 years ago by Matt Riggott

Documentation on the caching and the Site.objects.clear_cache() method.

comment:3 Changed 8 years ago by Simon G. <dev@…>

  • Triage Stage changed from Accepted to Ready for checkin

Changed 8 years ago by Matt Riggott

Formatting changes to the docs diff: lines wrapped at 80 characters and a "New in Django development version" notice added.

comment:4 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [6180]) Fixed #3766 -- Added in-memory caching for the sites framework. Will speed up all the "current site" lookups. Thanks, Matt Riggott.

Note: See TracTickets for help on using tickets.
Back to Top