Skip to main content

fastapi-cache-stable 0.8.0

Community-maintained, drop-in stable fork of fastapi-cache2. The Python import stays fastapi_cache; existing singleton users keep the compatible default.

0.8.0 release metadata. The published package version is 0.8.0. Python support is >=3.8,<3.15: 3.8–3.10 are functional legacy profiles and 3.11–3.14 are the security target. Free-threaded 3.14t is not included.

Documentation · Migration · Compatibility · Security · Support · Changelog.

Install the exact released artifact:

python -m pip install "fastapi-cache-stable==0.8.0"
python -m pip install "fastapi-cache-stable[redis]==0.8.0"

What is in 0.8.0

  • Opt-in application scope: CacheConfig, CacheHandle and CacheScopeError bind a cache to one FastAPI app with an explicit scope_id. Use @cache(scope="app"). The legacy singleton remains the default; scoped entries use a distinct physical-key envelope.
  • Opt-in failure policies: CacheFailurePolicy controls classified standalone Redis read transport errors, conservative responses after a failed SET, and one uncached recompute for exact built-in JSON syntax/UTF-8 failures. Every flag defaults to False; custom coders, Pickle, typed validation errors and tag conversion errors keep their previous behavior.
  • Backend contracts: an internal descriptor records capabilities and ownership for exact built-in InMemory and standalone Redis adapters. It does not change legacy Backend signatures or promote experimental providers.
  • Isolation evidence: installed wheel/sdist tests cover separate apps, identities, locales, conditional 304, private responses, cross-process scope reuse and rollback. The 0.7.2 comparison is descriptive; it is not a performance certification.

Scoped example

from contextlib import asynccontextmanager

from fastapi import FastAPI
from fastapi_cache import CacheConfig, CacheHandle
from fastapi_cache.backends.inmemory import InMemoryBackend
from fastapi_cache.decorator import cache


@asynccontextmanager
async def lifespan(app: FastAPI):
    handle = CacheHandle(
        CacheConfig(InMemoryBackend(), scope_id="orders-v1")
    )
    await handle.start(app)
    try:
        yield
    finally:
        await handle.aclose()


app = FastAPI(lifespan=lifespan)


@app.get("/orders")
@cache(scope="app", expire=60)
async def orders() -> list[str]:
    return ["order-1"]

CacheConfig supports exact InMemoryBackend and standalone RedisBackend for app scope. Use a unique scope_id per logical app on shared storage; duplicate IDs and direct external writes are not automatically detectable.

Boundaries

  • App scope is opt-in and does not auto-detect tenant, authorization, locale or arbitrary request context. Use a validated identity-aware key_builder and/or explicit vary_headers; the C4 evidence includes a negative hidden-context example. #53
  • The C4 comparison is descriptive and INCONCLUSIVE; the latest 0.8.0 re-run did not reproduce the earlier concurrent p50 outlier, but no latency, p95/p99, HA or no-regression claim is made. #100
  • #111 and #112 keep their broader residual scopes open; #45 (DynamoDB) remains experimental; #102 advanced Redis HA/TLS/Sentinel/ Cluster profiles remain outside this release.
  • Redis Cluster namespace clear, automatic tenant detection, single-flight, tags, stale serving and ownership transfer are not part of 0.8.0.
  • PickleCoder requires fully trusted cache bytes and store access; an ETag is not data integrity or authorization.

See the 0.8.0 release notes for the complete scope and the release evidence for the pending publication gates.

Metadata

Release files for fastapi-cache-stable 0.8.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 fastapi-cache-stable 0.8.0
File Size Uploaded Provenance Actions
fastapi_cache_stable-0.8.0.tar.gz 80.1 kB With provenance Details for fastapi_cache_stable-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-cache-stable 0.8.0
File Interpreter ABI Platform Actions
fastapi_cache_stable-0.8.0-py3-none-any.whl Python 3 none any Details for fastapi_cache_stable-0.8.0-py3-none-any.whl

Total release size: 112.3 kB

Release files / fastapi_cache_stable-0.8.0.tar.gz

Download URL fastapi_cache_stable-0.8.0.tar.gz
Size 80.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3eae593e5bc78f901c3b6ed7fd852b3910bb713a273e12cc9f5eecdac05e3d8b
BLAKE2b-256 checksum
How to use checksums
aedf895cf00ada8ac1dadf7537234f8f64479b7ab8e72b832fbc273e2ff97af2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / fastapi_cache_stable-0.8.0-py3-none-any.whl

Download URL fastapi_cache_stable-0.8.0-py3-none-any.whl
Size 32.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a7d200744424f88bfaee2a4b1fc6958e138aa86236c1906964d3cda41861bd1
BLAKE2b-256 checksum
How to use checksums
8e0f883583bba920a549f11c87d11c9e926fca53804776773261f5de2798abf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for fastapi-cache-stable 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fastapi_cache_stable-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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