Django

Code

Ticket #3766 (closed: fixed)

Opened 2 years ago

Last modified 1 year ago

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

Reported by: David Cramer <dcramer@gmail.com> Assigned to: nobody
Milestone: Component: Contrib apps
Version: SVN Keywords: sites
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

site_cache.diff (1.5 kB) - added by Matt Riggott on 08/06/07 17:02:21.
Patch to add Site object caching to django.contrib.sites.models.SiteManager?
sites_docs.diff (1.3 kB) - added by Matt Riggott on 08/07/07 17:27:58.
Documentation on the caching and the Site.objects.clear_cache() method.
sites_docs.2.diff (1.3 kB) - added by Matt Riggott on 09/10/07 14:45:35.
Formatting changes to the docs diff: lines wrapped at 80 characters and a "New in Django development version" notice added.

Change History

03/20/07 00:54:27 changed by Simon G. <dev@simon.net.nz>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • summary changed from Site Caching to django.contrib.sites should cache to reduce queries like contenttypes does.
  • needs_tests changed.
  • needs_docs changed.

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

08/06/07 17:02:21 changed by Matt Riggott

  • attachment site_cache.diff added.

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

08/06/07 17:02:58 changed by Matt Riggott

  • has_patch set to 1.
  • 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.

08/07/07 17:27:58 changed by Matt Riggott

  • attachment sites_docs.diff added.

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

08/20/07 05:37:46 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Accepted to Ready for checkin.

09/10/07 14:45:35 changed by Matt Riggott

  • 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.

09/14/07 03:37:09 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #3766 ([patch] django.contrib.sites should cache to reduce queries like contenttypes does)




Change Properties
Action