FastAPI缓存 将简单的轻量级缓存系统实现为FastAPI中的依赖项。 安装 pip install fastapi-cache 用法示例 from fastapi import Depends , FastAPI from fastapi_cache import caches , close_caches from fastapi_cache . backends . redis import CACHE_KEY , RedisCacheBackend app = FastAPI () def redis_cache (): return caches . get ( CACHE_KEY ) @ app . get ( '/' ) async def hello ( cache : RedisCacheBackend = Depends ( redis_cache
2022-03-09 16:32:43 14KB python redis cache pyton3
1
python-3.7.8rc1-amd64.exe
2021-11-02 20:00:40 25.75MB pyton3.7.8
1