Metadata-Version: 2.4
Name: fastapi-cache-stable
Version: 0.9.0
Summary: Community-maintained, drop-in stable fork of fastapi-cache2
License: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: fastapi,cache,caching
Author: Agustin Saiz
Author-email: agustinsaiz02@gmail.com
Requires-Python: >=3.8,<3.15
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: FastAPI
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Provides-Extra: all
Provides-Extra: dynamodb
Provides-Extra: memcache
Provides-Extra: redis
Requires-Dist: aiobotocore (>=2.13.1,<3.0.0) ; (python_version >= "3.10") and (extra == "dynamodb" or extra == "all")
Requires-Dist: aiohttp (>=3.14.4,<4.0.0) ; (python_version >= "3.10") and (extra == "dynamodb" or extra == "all")
Requires-Dist: aiomcache (>=0.8.2,<0.9.0) ; extra == "memcache" or extra == "all"
Requires-Dist: fastapi
Requires-Dist: importlib-metadata (>=6.6.0,<7.0.0) ; python_version < "3.8"
Requires-Dist: jinja2 (>=3.0)
Requires-Dist: pendulum (==3.0.*) ; python_version == "3.8"
Requires-Dist: pendulum (==3.1.*) ; python_version == "3.9"
Requires-Dist: pendulum (>=3.2,<4.0) ; python_version >= "3.10"
Requires-Dist: redis (>=4.2.0rc1,<6.2) ; (python_version == "3.8") and (extra == "redis" or extra == "all")
Requires-Dist: redis (>=4.2.0rc1,<7.1) ; (python_version == "3.9") and (extra == "redis" or extra == "all")
Requires-Dist: redis (>=4.2.0rc1,<8.2) ; (python_version >= "3.10" and python_version < "3.15") and (extra == "redis" or extra == "all")
Requires-Dist: time-machine (>=2.6.0) ; python_version < "3.9" and implementation_name != "pypy"
Requires-Dist: typing-extensions (>=4.1.0)
Project-URL: Documentation, https://agustin18.github.io/fastapi-cache/
Project-URL: Homepage, https://github.com/agustin18/fastapi-cache
Project-URL: Repository, https://github.com/agustin18/fastapi-cache.git
Description-Content-Type: text/markdown

# fastapi-cache-stable 0.9.0

Community-maintained, drop-in stable fork of
[fastapi-cache2](https://pypi.org/project/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](https://agustin18.github.io/fastapi-cache/) ·
> [Migration](https://github.com/agustin18/fastapi-cache/blob/stable/MIGRATION.md) ·
> [Compatibility](https://github.com/agustin18/fastapi-cache/blob/stable/COMPATIBILITY.md) ·
> [Security](https://github.com/agustin18/fastapi-cache/blob/stable/SECURITY.md) ·
> [Support](https://github.com/agustin18/fastapi-cache/blob/stable/SUPPORT.md) ·
> [Changelog](https://github.com/agustin18/fastapi-cache/blob/stable/CHANGELOG.md).

Install the exact release artifact:

```console
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

```python
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](https://github.com/agustin18/fastapi-cache/issues/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](https://github.com/agustin18/fastapi-cache/issues/97)
- Filtering applies only to the documented explicit-provider and scalar-key
  contract; unsupported configurations bypass caching. [#49](https://github.com/agustin18/fastapi-cache/issues/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](https://github.com/agustin18/fastapi-cache/blob/stable/docs/releases/RELEASE_NOTES_0.9.0.md)
for the complete scope and the [staging checklist](https://github.com/agustin18/fastapi-cache/blob/stable/docs/releases/RELEASE_CANDIDATE_0.9.0.md)
for publication gates. Published 0.8.0 remains the current release until
0.9.0 is separately authorized and promoted.

