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.1

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.1
File Size Uploaded
patera_caching-0.11.1.tar.gz 11.2 kB Details

Built distribution (wheel)

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

Release history Release notifications | RSS feed

This release

0.11.1 This release

2 release files

0.11.0

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