patera-caching
Response caching for Patera with in-memory, Redis and SQLite backends. Part of Patera, a modular async-first Python web framework.
Installation
pip install patera-caching
# or, with uv
uv add "patera[caching]"
Requires Python 3.13 or newer and patera>=0.121.
Usage
patera-caching caches responses of endpoints:
from patera.caching import Caching, CachingConfig, cache
class PublicCache(Caching):
pass # in-memory backend by default
class Config(BaseConfig):
...
PUBLIC_CACHE: CachingConfig = CachingConfig(DURATION=60, MAX_SIZE=1000)
@path("/stats")
class StatsApi(Controller[App]):
@get("/")
@cache("PUBLIC_CACHE", duration=15) # registered name of the extension
async def stats(self, req: Request) -> Response:
return req.res.json(await compute_stats())
See the Caching section of the Patera documentation for the full guide.
License
MIT. See LICENSE.
Metadata
Release files for patera-caching 0.11.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| patera_caching-0.11.1.tar.gz | 11.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| patera_caching-0.11.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.4 kB
Release files / patera_caching-0.11.1.tar.gz
| Download URL | patera_caching-0.11.1.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ff6a5489c3db462f5e9562853d7ba7302cc8d76addd9781cd9dcc760ce8c89b
|
|
BLAKE2b-256 checksum How to use checksums |
f067646322305faec71900c866aeade04750e793c63bfb5e6fe67416891c2c58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / patera_caching-0.11.1-py3-none-any.whl
| Download URL | patera_caching-0.11.1-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24dd1bc06619985962fd7b5400966edda91a6c0b0871ba14df079b018915f43a
|
|
BLAKE2b-256 checksum How to use checksums |
24ac90091697609356569e22e62390b0334a4595f78a4c27139a6c533a71f805
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|