Skip to main content

fastapi-cache-stable 0.9.0

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

0.9.0 release metadata. 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 release artifact:

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

What is in 0.9.0

  • Safe parameter filtering: @cache(exclude_params=...) excludes only explicitly declared, zero-argument service dependencies from the default key. Unsupported values, auth/request contexts, custom builders and ambiguous dependency configurations bypass caching instead of being silently ignored. The option is omitted by default and is not automatic tenant detection.
  • App-scoped tags: @cache(tags=...) and CacheHandle.invalidate_tags(...) add opt-in literal tags for bounded InMemory and standalone Redis app-scoped caching. Invalidation is scoped, bounded and does not perform a global flush.
  • Qualified Redis tag profile: tags require RedisBackend(..., enable_tags=True), app scope, redis-py 5.2.1, Redis 7.4 standalone, a finite socket timeout and noeviction. Redis Cluster, Sentinel, TLS, replication/HA and automatic retry/repair are not part of this profile. The existing default Redis path and client range remain unchanged.
  • Experimental DynamoDB correction: direct reads honor TTL, including explicit nonpositive TTL as an expired entry. DynamoDB remains experimental; clear is not implemented and no real-service parity is claimed.
  • Existing app scope and failure policies: CacheConfig, CacheHandle, CacheScopeError and CacheFailurePolicy remain available. Existing imports and the legacy singleton default stay compatible.
  • Installed evidence: V1b qualifies wheel/sdist, Python 3.8–3.14, real Redis 7.4.12, cross-version rollback and descriptive performance against published 0.8.0. No performance certification is implied.

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", tags=("orders",), expire=60)
async def orders() -> list[str]:
    return ["order-1"]

Use a unique scope_id per logical app on shared storage. Tagged Redis entries require an explicit RedisBackend(..., enable_tags=True) configured for the qualified client and server profile.

Boundaries

  • Filtering and tags are opt-in and do not auto-detect tenant, authorization, locale or arbitrary request context. Use a validated identity-aware key_builder and/or explicit bypass. #53
  • Tag invalidation does not revoke responses already in flight or held by an intermediary cache. Rotate the namespace or clear relevant entries during migration and rollback.
  • Redis tags do not support Cluster, Sentinel, TLS, HA, arbitrary client versions, unbounded cleanup or dirty-family repair. The documented limits apply. #97
  • Filtering applies only to the documented explicit-provider and scalar-key contract; unsupported configurations bypass caching. #49
  • DynamoDB remains experimental in 0.9.0; #45 lifecycle and real-service evidence remain open.
  • The V1b comparison is descriptive; #100 remains open and no latency, p95/p99, throughput or no-regression claim is made.
  • PickleCoder requires fully trusted cache bytes and store access; an ETag is not data integrity or authorization.

See the 0.9.0 release notes for the complete scope and the staging checklist for publication gates. Published 0.8.0 remains the current release until 0.9.0 is separately authorized and promoted.

Metadata

Release files for fastapi-cache-stable 0.9.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.9.0
File Size Uploaded Provenance Actions
fastapi_cache_stable-0.9.0.tar.gz 94.7 kB With provenance Details for fastapi_cache_stable-0.9.0.tar.gz

Built distribution (wheel)

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

Total release size: 142.9 kB

Release files / fastapi_cache_stable-0.9.0.tar.gz

Download URL fastapi_cache_stable-0.9.0.tar.gz
Size 94.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8156a9280cbc61c4b4ef7d3a958a77ea2f94f10c64f45a193236a0215b3369bd
BLAKE2b-256 checksum
How to use checksums
3d4d404e03a537149b2af1e5f46f834d1275a20b99bb3ad52f51f12ccd2f563f
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 28, 2026.

Transparency log

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

Download URL fastapi_cache_stable-0.9.0-py3-none-any.whl
Size 48.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b659873f19fc70e8ad878d35cf5ea4411b13c756e7a4098da0890d3053a222a
BLAKE2b-256 checksum
How to use checksums
bb5169525cd91f632e8088d5797df23d583de7b12aff89fd43e8b695016c56d0
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 28, 2026.

Transparency log

Security for fastapi-cache-stable 0.9.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.9.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 28, 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