fastapi-cache icon indicating copy to clipboard operation
fastapi-cache copied to clipboard

fastapi-cache is a tool to cache fastapi response and function result, with backends support redis and memcached.

Results 119 fastapi-cache issues
Sort by recently updated
recently updated
newest added

It would be nice to have an optional parameter such as `filter` in the `@cache` decorator that took as input a python callable w/ the wrapped function's `*args` and `**kwargs`...

enhancement

Hi! After upgrading to redis-py, the snippet [provided in the example](https://github.com/long2ice/fastapi-cache/blob/36e0812c1988ce45a623c825ef640ea1455c6338/examples/redis/main.py) doesn't correctly work. It fails with the following message: ``` File "/root/.cache/pypoetry/virtualenvs/backend-9TtSrW0h-py3.9/lib/python3.9/site-packages/fastapi/routing.py", line 226, in app raw_response = await...

bug
needs-triage

I'm trying to avoid caching when the result is empty is it possible ?

question

Hello! I do not completely understand why caching is [disabled for methods except for GET](https://github.com/long2ice/fastapi-cache/blob/820689ce9afce35c3f74d1c687925d65e9fa6799/fastapi_cache/decorator.py#L61), and if so, why is request passed as the first parameter to the function? In...

enhancement

As of fastapi-cache2[redis] version 0.1.9, I get the following error: `AttributeError: __aenter__`. The error happens here: https://github.com/long2ice/fastapi-cache/blob/v0.1.9/fastapi_cache/decorator.py#L53 Version 0.1.8 works fine for me. I'm get the error both with redis...

`__version__ = "0.1.9"` The `.clear` method needs to be made possible to call without having to have called `.init` before. You can have a genuine user case, such as when...

diskcache: [github](https://github.com/grantjenks/python-diskcache) I think `diskcache` is a good library to use in the absence of an installable backend. `diskcache` is a library that uses local drive and `sqlite`, and is...

So I have an endpoint I need to cache for a short time because it can get a lot of the same request at the same time. I use InMemory...

documentation
question

This PR makes it possible to use async function for the key_builder (useful for example when the route function is async, and it is needed to extract the body of...