CacheManager Class
A class for managing a disk-based cache with expiration for cached data.
- param cache_directory:
Path to the directory for storing cache data.
- type cache_directory:
str
- param max_cache_days:
Maximum number of days a cached entry is considered valid.
- type max_cache_days:
int
- sckan_compare.cachemanager.CacheManager.cache
Disk cache object for storing data.
- Type:
diskcache.Cache
- sckan_compare.cachemanager.CacheManager.max_cache_days
Maximum number of days a cached entry is considered valid.
- Type:
int
- __init__(cache_directory, max_cache_days):
Initialize the CacheManager class.
- create_disk_cache(directory):
Create a disk cache object.
- get_cached_data(key):
Retrieve cached data associated with a given key.
- cache_data(key, data):
Cache data with an associated key.
- invalidate_old_cache_entries():
Remove cached entries that have expired.