def set_cache(cache):
    """Set the caching options. It is recommended to
    set it via environment variables.

    Use a shared directory:
    `FILE_CACHE=/path/to/cache`

    Use redis:
    `REDIS_CACHE=redis://example.com:6379`

    Default is that a local cache will be used. This
    local cache is not distributed, so use it only it
    in environments where you use one process!
    """
    globals['cache'] = cache
