Permalink
Browse files

Remove FEINCMS_USE_CACHE, it really doesn't serve any meaningful purpose

  • Loading branch information...
1 parent 5cdb75f commit cf8563264e7c53b21bb4dc60da206ba460671f1b Martin J. Laubach committed Oct 20, 2011
Showing with 7 additions and 16 deletions.
  1. +0 −5 feincms/default_settings.py
  2. +7 −10 feincms/module/page/models.py
  3. +0 −1 tests/tests.py
@@ -62,11 +62,6 @@
# ------------------------------------------------------------------------
# Various settings
-# ------------------------------------------------------------------------
-#: Enable caching intermediate results in feincms. Be aware that this might deliver
-#: slightly out of date pages if you are not using the 'changedate' page extension.
-FEINCMS_USE_CACHE = getattr(settings, 'FEINCMS_USE_CACHE', False)
-
# ------------------------------------------------------------------------
#: Allow random gunk after a valid page?
FEINCMS_ALLOW_EXTRA_PATH = getattr(settings, 'FEINCMS_ALLOW_EXTRA_PATH', False)
@@ -106,11 +106,10 @@ def best_match_for_path(self, path, raise404=False):
# We flush the cache entry on page saving, so the cache should always
# be up to date.
- if settings.FEINCMS_USE_CACHE:
- ck = path_to_cache_key(path)
- page = django_cache.get(ck)
- if page:
- return page
+ ck = path_to_cache_key(path)
+ page = django_cache.get(ck)
+ if page:
+ return page
if path:
tokens = path.split('/')
@@ -119,8 +118,7 @@ def best_match_for_path(self, path, raise404=False):
try:
page = self.active().filter(_cached_url__in=paths).extra(
select={'_url_length': 'LENGTH(_cached_url)'}).order_by('-_url_length')[0]
- if settings.FEINCMS_USE_CACHE:
- django_cache.set(ck, page)
+ django_cache.set(ck, page)
return page
except IndexError:
if raise404:
@@ -331,9 +329,8 @@ def save(self, *args, **kwargs):
super(Page, self).save(*args, **kwargs)
# Okay, we changed the URL -- remove the old stale entry from the cache
- if settings.FEINCMS_USE_CACHE:
- ck = path_to_cache_key( self._original_cached_url.strip('/') )
- django_cache.delete(ck)
+ ck = path_to_cache_key( self._original_cached_url.strip('/') )
+ django_cache.delete(ck)
# If our cached URL changed we need to update all descendants to
# reflect the changes. Since this is a very expensive operation
View
@@ -258,7 +258,6 @@ def setUp(self):
('sidebar', 'Sidebar', 'inherited'),
),
})
- feincms_settings.FEINCMS_USE_CACHE = True
def login(self):
self.assertTrue(self.client.login(username='test', password='test'))

0 comments on commit cf85632

Please sign in to comment.