Skip to main content

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)

Source distribution for patera-caching 0.11.0
File Size Uploaded
patera_caching-0.11.0.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for patera-caching 0.11.0
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

0.11.1

2 release files

This release

0.11.0 This release

2 release files

0.10.0

1 release file

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.11

2 release files

0.4.10

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page