Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit cf8563264e7c53b21bb4dc60da206ba460671f1b 1 parent 5cdb75f
Martin J. Laubach authored
View
5 feincms/default_settings.py
@@ -63,11 +63,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)
View
17 feincms/module/page/models.py
@@ -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
1  tests/tests.py
@@ -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'))
Please sign in to comment.
Something went wrong with that request. Please try again.