'save value for the given key.
:param key: must be a ``/`` separated value. Usually the first
name is the name of your plugin or your application.
:param value: must be of any combination of basic
python types, including nested types
like e. g. lists of dictionaries.'

def set(self, key, value):

    path = self._getvaluepath(key)
    try:
        path.dirpath().ensure_dir()
    except (py.error.EEXIST, py.error.EACCES):
        self.config.warn(code='I9', message=('could    not    create    cache    path    %s' % (path,)))
        return
    try:
        f = path.open('w')
    except py.error.ENOTDIR:
        self.config.warn(code='I9', message=('cache    could    not    write    path    %s' % (path,)))
    else:
        with f:
            self.trace(('cache-write    %s:    %r' % (key, value)))
            json.dump(value, f, indent=2, sort_keys=True)
