linotp.lib.cache module¶
- linotp.lib.cache.get_cache(cache_name: str, scope: Optional[str] = None) Optional[Cache] ¶
load the cache with cache_name and scope
Each cache defines the following configuration parameters:
- linotp.{cache_name}_cache.enabled
Whether the cache is enabled. Defaults to True
- linotp.{cache_name}_cache.expiration
How long the entries are cached for in seconds. Defaults to 3 days.
- Remark
This cache is only enabled, if the configuration entry ‘enabled’ evaluates to True and the expiration is of a valid format. Expiration format is defined linotp.lib.type_utils
- Parameters
cache_name – the name of the cache
scope – there are related caches, which names are extended by scope used for realm specific caches e.g. for users
- Returns
the cache or None if not enabled,
wrt to typing the cache is not deterministic as the cache type is returned by the app.getCacheManager() which could be a beaker or something else