fastapi-cache
fastapi-cache copied to clipboard
fastapi-cache is a tool to cache fastapi response and function result, with backends support redis and memcached.
My code is as follows: ```python @app.post('/oneline', response_model=ClassifyResult) @cache() async def predict(sentences: Sentences,request:Request): texts = sentences.texts type = sentences.type ``` It reports error ```python File "C:\Users\fang_\anaconda3\envs\hmqf_dl\lib\site-packages\fastapi_cache\decorator.py", line 52, in inner...
Hello! README.md example usedold aioredis, I have updated it to use redis-py. Also, the poetry extra dependency for 'redis' had aioredis and not normal redis, leading to aioredis being installed...
After calling an API decorated by fastapi-cache: ``` Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi result = await app(self.scope, self.receive, self.send) File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in...
Not working example: ```python class A: @cache(namespace="app", expire=3600) async def test(self, a=True): print("test") return [], [], [] ``` Working example: ```python class A: @staticmethod @cache(namespace="app", expire=3600) async def test(a=True): print("test")...
I have a function that utilizes the raw starlette request to parse the path_parameters in order to provide dynamic content. Right now, the cache implementation returns the same cached result...
Wondering how to go about handling Redis failure and keeping app availability I know that we should treat redis like any other database, but is there any way to handle...
I have a few integration tests than run as part of jenkins job, but I have been unable to get pytests to run and connect to the redis cache. I...
added an example of InMemory Backend
I try cache for fastapi but i not know if post method is caching, or is only for get method
I receive an auth token from the frontend with an expiry date in the future. I would like to cache it until expiry date, but the problem is the expiry...