mirror of
https://github.com/furyhawk/agent_delta.git
synced 2026-07-21 10:15:36 +00:00
15 lines
425 B
Python
15 lines
425 B
Python
"""Caching configuration using fastapi-cache2."""
|
|
|
|
from fastapi_cache import FastAPICache
|
|
from fastapi_cache.backends.redis import RedisBackend
|
|
|
|
from app.clients.redis import RedisClient
|
|
|
|
|
|
def setup_cache(redis: RedisClient) -> None:
|
|
"""Initialize FastAPI cache with Redis backend.
|
|
|
|
Uses the shared Redis client from lifespan state.
|
|
"""
|
|
FastAPICache.init(RedisBackend(redis.raw), prefix="agent_delta:cache:")
|