Cache library for FastAPI with tag based invalidation
Project description
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 for an example.
Installation
With in-memory support only:
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 library):
pip install fastapi-caching[redis]
Usage examples
Examples on how to use can be found here.
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastapi-caching-0.3.0.tar.gz
(7.6 kB
view hashes)
Built Distribution
Close
Hashes for fastapi_caching-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 023e0eb313c31f3e3242b2b262df635dfb6d90ecc49f30614207ff42b1be40fe |
|
MD5 | 1db395e228d6e34bb5b11c4b0c4795ab |
|
BLAKE2b-256 | b9ffa21410e334389135103b9f30be86cbb1eb5e5c80adfe85ef3ddadb128792 |