class documentation

class FileBasedCache(BaseCache):

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method ​_createdir Undocumented
Method ​_cull Remove random cache entries if max_entries is reached at a ratio of num_entries / cull_frequency. A value of 0 for CULL_FREQUENCY means that the entire cache will be purged.
Method ​_delete Undocumented
Method ​_is​_expired Take an open cache file f and delete it if it's expired.
Method ​_key​_to​_file Convert a key into a cache file path. Basically this is the root cache path joined with the md5sum of the key and a suffix.
Method ​_list​_cache​_files Get a list of paths to all the cache files. These are all the files in the root cache dir that end on the cache_suffix.
Method ​_write​_content Undocumented
Method add Undocumented
Method clear Remove all the cache files.
Method delete Undocumented
Method get Undocumented
Method has​_key Undocumented
Method set Undocumented
Method touch Undocumented
Class Variable cache​_suffix Undocumented
Instance Variable ​_dir Undocumented
def __init__(self, dir, params):

Undocumented

def _createdir(self):

Undocumented

def _cull(self):
Remove random cache entries if max_entries is reached at a ratio of num_entries / cull_frequency. A value of 0 for CULL_FREQUENCY means that the entire cache will be purged.
def _delete(self, fname):

Undocumented

def _is_expired(self, f):
Take an open cache file f and delete it if it's expired.
def _key_to_file(self, key, version=None):
Convert a key into a cache file path. Basically this is the root cache path joined with the md5sum of the key and a suffix.
def _list_cache_files(self):
Get a list of paths to all the cache files. These are all the files in the root cache dir that end on the cache_suffix.
def _write_content(self, file, timeout, value):

Undocumented

def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None):

Undocumented

def clear(self):
Remove all the cache files.
def delete(self, key, version=None):

Undocumented

def get(self, key, default=None, version=None):

Undocumented

def has_key(self, key, version=None):

Undocumented

def set(self, key, value, timeout=DEFAULT_TIMEOUT, version=None):

Undocumented

def touch(self, key, timeout=DEFAULT_TIMEOUT, version=None):

Undocumented

cache_suffix: str =

Undocumented

_dir =

Undocumented