Skip to content

Commit

Permalink
Update the documenation on cache backend
Browse files Browse the repository at this point in the history
  • Loading branch information
batiste committed Jan 19, 2016
1 parent 1d57d03 commit 44d9381
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
18 changes: 16 additions & 2 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,23 @@ setting-up a cache-backend_ to have decent performance.

.. _cache-backend: http://docs.djangoproject.com/en/dev/topics/cache/#setting-up-the-cache

You can easily setup a local memory cache this way::
If you want to setup a specific cache for Gerbi CMS instead of using the default you
can do it by setting up the 'pages' cache entry::

CACHES = {
'default': ...
'pages': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}

.. note::

The cache has been designed with memcache in mind: a single point of truth for cache. The CMS
invalidates the cache actively when changes are made. That means that you need a central cache if
you run this CMS in serveral processes otherwise the caches will become inconsitent.

CACHE_BACKEND = "locmem:///?max_entries=5000"

The sites framework
-------------------
Expand Down
5 changes: 0 additions & 5 deletions doc/settings-list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ PAGE_EXTRA_CONTEXT
This setting is a function that can be defined if you need to pass extra
context data to the pages templates.

PAGE_CACHE_LOCATION
==================================

Allows you to use a cache other than 'default' for cms caching.

PAGE_TESTS_SAVE_SCREENSHOTS
==================================

Expand Down
4 changes: 2 additions & 2 deletions pages/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.core.cache import caches

if hasattr(caches, 'pages'):
cache = caches['pages']
cache = caches['pages']
else:
cache = caches['default']
cache = caches['default']

4 changes: 0 additions & 4 deletions pages/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,6 @@ def _default_tagging_field():
# Enable the API or not
PAGE_API_ENABLED = getattr(settings, 'PAGE_API_ENABLED', False)

# If you want to have a separate cache for cms, override this
PAGE_CACHE_LOCATION = get_setting('PAGE_CACHE_LOCATION',
default_value='default')

# If you want to see screenshots from selenium tests override this
PAGE_TESTS_SAVE_SCREENSHOTS = getattr(settings, 'PAGE_TESTS_SAVE_SCREENSHOTS',
False)
Expand Down

0 comments on commit 44d9381

Please sign in to comment.