Opened 18 years ago

Closed 17 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: dev
Severity: Keywords: sites
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 17 years ago.
Patch to add Site object caching to django.contrib.sites.models.SiteManager
sites_docs.diff (1.3 KB ) - added by Matt Riggott 17 years ago.
Documentation on the caching and the Site.objects.clear_cache() method.
sites_docs.2.diff (1.3 KB ) - added by Matt Riggott 17 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 by Simon G. <dev@…>, 18 years ago

Summary: Site Cachingdjango.contrib.sites should cache to reduce queries like contenttypes does
Triage Stage: UnreviewedAccepted

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

by Matt Riggott, 17 years ago

Attachment: site_cache.diff added

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

comment:2 by Matt Riggott, 17 years ago

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

by Matt Riggott, 17 years ago

Attachment: sites_docs.diff added

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

comment:3 by Simon G. <dev@…>, 17 years ago

Triage Stage: AcceptedReady for checkin

by Matt Riggott, 17 years ago

Attachment: sites_docs.2.diff added

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

comment:4 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(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