apifrom.utils.cache_advanced ============================ .. py:currentmodule:: apifrom.utils.cache_advanced Overview -------- **Classes** * :py:class:`CacheBackend` * :py:class:`CacheItem` * :py:class:`MemoryCacheBackend` Classes ------- .. py:class:: CacheBackend:bases: Generic[T] Base cache backend interface. .. method:: clear() :abstractmethod: :async: Clear the entire cache. .. method:: delete(key) :abstractmethod: :async: Delete a value from the cache. .. method:: delete_by_dependencies(keys) :abstractmethod: :async: Delete values with specified dependencies. .. method:: delete_by_tags(tags) :abstractmethod: :async: Delete values with specified tags. .. method:: get(key) :abstractmethod: :async: Get a value from the cache. .. method:: set(key, value, ttl = None, tags = None, dependencies = None) :abstractmethod: :async: Set a value in the cache. .. py:class:: CacheItem(key, value, expires_at = None, tags = None, dependencies = None):bases: Generic[T] Cache item with metadata. .. :: dependencies .. :: expires_at .. :: key .. :: tags .. :: value .. py:class:: MemoryCacheBackend(max_size = None):bases: CacheBackend[T] In-memory cache backend implementation. .. :: cache :annotation: Dict[str, CacheItem[T]] .. :: max_size .. method:: clear() :async: Clear the entire cache. .. method:: delete(key) :async: Delete a value from the cache. .. method:: delete_by_dependencies(keys) :async: Delete values with specified dependencies. .. method:: delete_by_tags(tags) :async: Delete values with specified tags. .. method:: get(key) :async: Get a value from the cache. .. method:: set(key, value, ttl = None, tags = None, dependencies = None) :async: Set a value in the cache.