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

The current setup is to explicitly call `cache()` decorator on every API endpoints. Any suggestion how to do this globally? Dependency injection seems not to work

**Summary:** Added optional custom event handlers for new_key and existing_key. Also added tests to cover the event handlers and custom key builder **Example** For the events `new_key` and `existing_key` you...

added `no-cache` to cache exclusion on headers on request

I noticed that the `Cache-Control` and `ETag` headers are not included for the first response. It takes a second request to generate and include these headers in the response. From...

Is there a possibility to set different expire value for cached responses depending on status code from external API. E.g. if status code is `200` than it should be cached...

![Redis Multiple Keys](https://user-images.githubusercontent.com/19611340/127081313-7634d907-d2d0-44f1-8b77-04c36d39fb41.png) As seen from the screenshot, when trying to reach the same endpoint before expiring, nothing is being retrieved from redis.

bug

For memcached, TTL is returned as const of 3600. For caches below that amount, stale data keeps being served.

Is there a way of avoiding pydantic response model validation when using cache?

Hi, Redis-server can be down and here is a small fix to deal with it. The decorator will crash if `ConnectionRefusedError` is not catched during the several async call to...