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.0
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.0.tar.gz | 11.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| patera_caching-0.11.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.4 kB
Release files / patera_caching-0.11.0.tar.gz
| Download URL | patera_caching-0.11.0.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba174f1accfbb5d7504a6bbcddadd5d3bfc16ee2cf438af4d2412d67b19657ed
|
|
BLAKE2b-256 checksum How to use checksums |
268cebcad9930323e0e78b475f86cfdd69aa3f6fc9bcfdcd600b2f9971d2f6b9
|
| 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.0-py3-none-any.whl
| Download URL | patera_caching-0.11.0-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cdb73cc479adc135f9520a11c89f44f12322dcca410d7808f05ac977179b7f6e
|
|
BLAKE2b-256 checksum How to use checksums |
4e0ef6540c50cdc9b7bcb779a18bcf78271d5e4dad24c535c95df6febcb9a2bd
|
| 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}
|