New in version 1.3.

There is a Superdesk wrapper for Hermes cache.

Basic usage is:

from superdesk.cache import cache

def some_func(foo):
    return foo * 5

class Service():

    def foo(self):

Cache providers


This one is enabled by default, using REDIS_URL for config.


In order to use memcached:
  • install python3-memcached library
  • set SUPERDESK_CACHE_URL env var to your memcached instance, or set it via CACHE_URL in settings.

App Context

It requires for the config, you can still annotate methods/functions before the app is created, but you can not call these methods before there is an app context in place.


Cache handles superdesk data encoding/decoding so you will get datetime and ObjectId instances. However, it doesn’t handle yet more complex types - like Cursor objects returned after mongo/elastic queries:

def return_from_db():
    return get_resource_service('foo').get()

Will raise an error. What you can do instead:

def return_from_db():
    return [doc for doc in get_resource_service('foo').get()]