Skip to content
Packages Examples Agents Blog Get started

Oridecon Cache - Multi-backend caching system for Oridecon Framework.

Section titled “Oridecon Cache - Multi-backend caching system for Oridecon Framework.”
  • def getattr(name: str) -> Any

  • def dir() -> Any

Admin contributor for oridecon-cache — surfaces cache hit/miss, eviction,

Section titled “Admin contributor for oridecon-cache — surfaces cache hit/miss, eviction,”

Shared Jinja2 renderer for oridecon-cache admin widgets.

Section titled “Shared Jinja2 renderer for oridecon-cache admin widgets.”

Frozen view models for oridecon-cache admin widgets.

Section titled “Frozen view models for oridecon-cache admin widgets.”

Backend factory helpers for Oridecon Cache provider.

Section titled “Backend factory helpers for Oridecon Cache provider.”

Memory cache backend implementation using oridecon-components.

Section titled “Memory cache backend implementation using oridecon-components.”

In-memory storage implementation for Oridecon.

Section titled “In-memory storage implementation for Oridecon.”
  • class InMemoryStorage:

    Namespace-aware in-memory storage backend backed by MemoryStateStore.

    Section titled “Namespace-aware in-memory storage backend backed by MemoryStateStore.”
    init(self, max_size: int = 10000, default_ttl: int | None = None, cleanup_interval: int = 60) -> None
    • def init(self, max_size: int = 10000, default_ttl: int | None = None, cleanup_interval: int = 60) ->
    • @property
    • def storage_type(self) -> StorageType
    • async def connect(self) -> None
    • async def disconnect(self) -> None
    • async def get(self, key: str, namespace: str | None = None) -> Any | None
    • async def set(self, key: str, value: Any, namespace: str | None = None, ttl: int | None = None) -> bool
    • async def delete(self, key: str, namespace: str | None = None) -> bool
    • async def exists(self, key: str, namespace: str | None = None) -> bool
    • async def list_keys(self, pattern: str | None = None, namespace: str | None = None) -> list[str]
    • async def clear(self, namespace: str | None = None) -> bool
    • async def _periodic_cleanup(self) -> None
    • async def _cleanup_expired(self) -> None

Redis cache backend implementation using the centralized StateStoreProtocol protocol.

Section titled “Redis cache backend implementation using the centralized StateStoreProtocol protocol.”

Local circuit breaker backend types for oridecon-cache.

Section titled “Local circuit breaker backend types for oridecon-cache.”

Resilience backends for the Oridecon cache package.

Section titled “Resilience backends for the Oridecon cache package.”

Resilient Redis cache backend — decorator composition (D3.3).

Section titled “Resilient Redis cache backend — decorator composition (D3.3).”

Cache backend registry for extensible cache backends.

Section titled “Cache backend registry for extensible cache backends.”

Cache repository generator for creating cached data repositories.

Section titled “Cache repository generator for creating cached data repositories.”

CLI shell context factories for oridecon-cache.

Section titled “CLI shell context factories for oridecon-cache.”
  • global ENV_PREFIX: str = ‘ORI_CACHE__’

  • global ENV_NESTED_DELIMITER: str = ’__’

  • global ENV_VAR_ORI_ENV: str = ‘ORI_ENV’

  • global DEFAULT_CACHE_NAME: str = ‘cache’

  • global DEFAULT_CACHE_VERSION: str = ‘1.0.0’

  • global DEFAULT_CACHE_ENABLED: bool = True

  • global DEFAULT_CACHE_ENVIRONMENT: str = ‘development’

  • global DEFAULT_CACHE_DEBUG: bool = False

  • global DEFAULT_SERVICE_PROTECTION_ENABLED: bool = True

  • global DEFAULT_SERVICE_METRICS_ENABLED: bool = True

  • global DEFAULT_SERVICE_HEALTH_CHECKS_ENABLED: bool = True

  • global DEFAULT_SERVICE_CIRCUIT_BREAKER_ENABLED: bool = False

  • global DEFAULT_SERVICE_CIRCUIT_BREAKER_THRESHOLD: int = 5

  • global DEFAULT_SERVICE_SERIALIZER: str = ‘json’

  • global DEFAULT_SERVICE_ALLOW_PICKLE: bool = False

  • global DEFAULT_PROTECTION_LOCK_TTL: int = 30

  • global DEFAULT_PROTECTION_MAX_WAIT: float = 10.0

  • global DEFAULT_PROTECTION_RETRY_INTERVAL: float = 0.1

  • global DEFAULT_MEMORY_NAME: str = ‘memory’

  • global DEFAULT_MEMORY_ENABLED: bool = True

  • global DEFAULT_MEMORY_DEFAULT: bool = False

  • global DEFAULT_MEMORY_CLEANUP_INTERVAL: int = 60

  • global DEFAULT_REDIS_NAME: str = ‘redis’

  • global DEFAULT_REDIS_HOST: str = ‘localhost’

  • global DEFAULT_REDIS_PORT: int = 6379

  • global DEFAULT_REDIS_DB: int = 0

  • global DEFAULT_REDIS_ENABLED: bool = True

  • global DEFAULT_REDIS_DEFAULT: bool = False

  • global DEFAULT_REDIS_SSL: bool = False

  • global DEFAULT_REDIS_CONNECTION_POOL_SIZE: int = 10

  • global DEFAULT_REDIS_SOCKET_TIMEOUT: float = 5.0

  • global DEFAULT_REDIS_RETRY_ON_TIMEOUT: bool = True

  • global DEFAULT_MEMCACHED_NAME: str = ‘memcached’

  • global DEFAULT_MEMCACHED_HOST: str = ‘localhost’

  • global DEFAULT_MEMCACHED_PORT: int = 11211

  • global DEFAULT_MEMCACHED_ENABLED: bool = True

  • global DEFAULT_MEMCACHED_DEFAULT: bool = False

  • global DEFAULT_LOCK_KEY_PREFIX: str = ‘lock:’

  • global DEFAULT_LOCK_TTL: int = 30

  • global DEFAULT_LOCK_RENEWAL_INTERVAL_DIVISOR: int = 2

  • global COMPRESSION_MARKER_UNCOMPRESSED: bytes = b’\x00’

  • global COMPRESSION_MARKER_COMPRESSED: bytes = b’\x01’

  • global DEFAULT_COMPRESSION_THRESHOLD: int = 1024

  • global DEFAULT_COMPRESSION_LEVEL: int = 6

  • global INSECURE_PASSWORDS: tuple[str, …]

  • global BACKEND_TYPE_MEMORY: str = ‘memory’

  • global BACKEND_TYPE_REDIS: str = ‘redis’

  • global BACKEND_TYPE_MEMCACHED: str = ‘memcached’

  • global CACHE_STATUS_HIT: str = ‘hit’

  • global CACHE_STATUS_MISS: str = ‘miss’

  • global CACHE_STATUS_SET: str = ‘set’

  • global CACHE_STATUS_DELETE: str = ‘delete’

  • global CACHE_STATUS_ERROR: str = ‘error’

  • global CACHE_STATUS_EXPIRED: str = ‘expired’

  • global CACHE_STATUS_STALE: str = ‘stale’

  • global ERROR_MSG_CACHE_TIMEOUT: str = ‘Cache operation timed out’

  • global ERROR_MSG_CACHE_CONFIGURATION: str = ‘Cache configuration error’

  • global ERROR_MSG_CACHE_STAMPEDE: str = ‘Cache stampede protection error’

  • global ERROR_MSG_CACHE_INVALIDATION: str = ‘Cache invalidation failed’

  • global ERROR_MSG_REDIS_INSTALL: str = ‘Redis backend requires redis package. Install with: pip install oridecon-cache[redis]’

  • global ERROR_MSG_MEMCACHED_INSTALL: str = ‘Memcached backend requires pylibmc or python-memcached. Install with: pip install oridecon-cache[memcached]’

  • global ERROR_MSG_PYYAML_INSTALL: str = ‘PyYAML is required for YAML configuration loading’

  • global ERROR_MSG_INSECURE_PASSWORD: str = “CRITICAL SECURITY ERROR: Insecure {backend} password detected in PRODUCTION for backend ‘{name}’.\nYou MUST set a secure password via {env_var}.”

  • global ERROR_MSG_INSECURE_URL: str = “CRITICAL SECURITY ERROR: Insecure {backend} URL detected in PRODUCTION for backend ‘{name}’.\nYou MUST set a secure {backend} URL via {env_var}.”

  • global DEFAULT_ENCODING: str = ‘utf-8’

Integration layer for Oridecon Cache provider.

Section titled “Integration layer for Oridecon Cache provider.”
  • global T

Root hook payload surface for oridecon-cache.

Section titled “Root hook payload surface for oridecon-cache.”
  • class LockContextManager:

    Async context manager for distributed locks.

    Section titled “Async context manager for distributed locks.”
    init(self, redis: Any, key: str, ttl: int, auto_renew: bool) -> None
    • def init(self, redis: Any, key: str, ttl: int, auto_renew: bool) -> None
    • async def aenter(self) -> AutoRenewingLock
    • async def aexit(self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: object) -> None

Distributed lock with automatic TTL renewal.

Section titled “Distributed lock with automatic TTL renewal.”

RepositoryProtocol pattern implementations for Oridecon Cache.

Section titled “RepositoryProtocol pattern implementations for Oridecon Cache.”

Semantic cache for LLM response caching with vector similarity search.

Section titled “Semantic cache for LLM response caching with vector similarity search.”
  • def getattr(name: str) -> Any

  • def dir() -> Any

Cost-aware semantic cache hit decision logic.

Section titled “Cost-aware semantic cache hit decision logic.”

Internal protocols for semantic cache vector indexing.

Section titled “Internal protocols for semantic cache vector indexing.”

Three-tier semantic cache store for LLM response caching.

Section titled “Three-tier semantic cache store for LLM response caching.”

FAISS-backed vector index for semantic cache.

Section titled “FAISS-backed vector index for semantic cache.”

Serialization abstraction layer for Oridecon Cache.

Section titled “Serialization abstraction layer for Oridecon Cache.”

Cache serializer with automatic compression for large values.

Section titled “Cache serializer with automatic compression for large values.”

AsyncStringSerializerProtocol helpers for provider initialization.

Section titled “AsyncStringSerializerProtocol helpers for provider initialization.”

JSON-based serializer implementation for Oridecon Cache.

Section titled “JSON-based serializer implementation for Oridecon Cache.”

MessagePack serializer for Oridecon Cache.

Section titled “MessagePack serializer for Oridecon Cache.”

HMAC-signed pickle serializer for Oridecon Cache.

Section titled “HMAC-signed pickle serializer for Oridecon Cache.”

Core cache service implementation for Oridecon Framework.

Section titled “Core cache service implementation for Oridecon Framework.”

Caching decorators for Oridecon Framework.

Section titled “Caching decorators for Oridecon Framework.”

Service factory helpers for provider initialization.

Section titled “Service factory helpers for provider initialization.”

Health and metrics helpers for the Oridecon cache provider.

Section titled “Health and metrics helpers for the Oridecon cache provider.”

Cache-aside, write-through, and stampede-protected pattern mixin.

Section titled “Cache-aside, write-through, and stampede-protected pattern mixin.”

Cache status handler registry for metrics collection.

Section titled “Cache status handler registry for metrics collection.”

Request-scoped in-process cache backed by :mod:contextvars.

Section titled “Request-scoped in-process cache backed by :mod:contextvars.”

Stampede protection utilities extracted from protection.py.

Section titled “Stampede protection utilities extracted from protection.py.”

CacheWarmer — proactive cache pre-loading at boot or on schedule (D6.4).

Section titled “CacheWarmer — proactive cache pre-loading at boot or on schedule (D6.4).”

Tiered caching strategy for Oridecon Cache.

Section titled “Tiered caching strategy for Oridecon Cache.”

Write-through caching strategy for Oridecon Cache.

Section titled “Write-through caching strategy for Oridecon Cache.”