Caching in Divio Cloud applications¶

    Caching in Divio Cloud applications will typically make use of Django’s own caching framework.

    Our default cache backend is ; all DivioCloud projects are set up with this configured and ready to use.

    This is a fast, scalable option, and is suited to most needs.

    Database caching is shared by all instances of an application server.

    Warning

    Depending on the needs of other applications, you may or may not find thatthese options are suitable.

    Per-instance caching options cache data for a particular instance of the cloudapplication server. This means that if your project is running on multipleserver instances, they will not share the caches.

    For the same reason if you SSH into a Cloud server and do:

    in a Python shell, you will only clear the cache in the container you have juststarted up.

    Options are:

    If it suits your needs, you can procure a Redis or other caching instance froma provider and use it with your Divio Cloud project.

    Caching in django CMS¶

    The Aldryn django CMS addon applies caching rules by default, via the setting.

    Control over caching settings is exposed in the Divio Cloud Control Panel in the configurationoptions for Aldryn django CMS.

    Defaults are to cache content for 60 seconds and menus for one hour.

    It is often convenient to disable this while developing or working intensively on content. Adding:

    1. import os
    2. env = os.getenv
    3. STAGE = env('STAGE', 'local').lower()
    4. CMS_PAGE_CACHE = False
    5. CMS_PLACEHOLDER_CACHE = False
    6. CMS_CACHE_DURATIONS = {
    7. 'menus': 0,
    8. 'content': 0,
    9. }