Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacobsvante/fastapi-caching
Cache library for FastAPI with tag based invalidation
https://github.com/jacobsvante/fastapi-caching
Last synced: 11 days ago
JSON representation
Cache library for FastAPI with tag based invalidation
- Host: GitHub
- URL: https://github.com/jacobsvante/fastapi-caching
- Owner: jacobsvante
- Created: 2020-08-16T11:09:28.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-08T11:23:06.000Z (over 2 years ago)
- Last Synced: 2024-05-13T00:02:56.845Z (6 months ago)
- Language: Python
- Size: 24.4 KB
- Stars: 18
- Watchers: 2
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-fastapi - :octocat: fastapi-caching :star: 10+ :fork_and_knife: 0+ - Cache library for FastAPI with tag based invalidation. (Caching)
README
# FastAPI-Caching
Cache library for FastAPI with tag based invalidation. Asynchronous only for the time being.
## Features
- Automatic response cache fetching using FastAPI dependencies
- Fine-grained control over when to return and set the cache
- Ability to invalidate cached objects based on a concept of associated tags. See [examples/redis_app](/examples/redis_app) for an example.## Installation
With in-memory support only:
```bash
pip install fastapi-caching
```NOTE: In-memory backend is only recommended when your app is only run as a single instance.
With redis support (through the [aioredis](https://aioredis.readthedocs.io/) library):
```bash
pip install fastapi-caching[redis]
```## Usage examples
Examples on how to use [can be found here](/examples).
## Limitations
- Only supported within async contexts.
## Changelog
### v0.1.2, 2020-08-16
- Feature: Support lazy setup of cache manager
### v0.2.0, 2020-08-16
- Breaking change: Revert to requiring `backend` to be passed to CacheManager
- Feature: Support lazy configuration of the caching backend### v0.3.0, 2020-08-16
- Feature: Add functionality to disable (and re-enable) caching.