From dacd7e1b0f951f7e3c844193851ff2021b0b2620 Mon Sep 17 00:00:00 2001 From: Lucca Leme Marques Date: Mon, 23 Aug 2021 11:51:28 -0300 Subject: [PATCH 1/2] add `no-cache` to cache exclusion --- fastapi_cache/decorator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi_cache/decorator.py b/fastapi_cache/decorator.py index 07573b1..b12a0d2 100644 --- a/fastapi_cache/decorator.py +++ b/fastapi_cache/decorator.py @@ -29,7 +29,7 @@ def cache( copy_kwargs = kwargs.copy() request = copy_kwargs.pop("request", None) response = copy_kwargs.pop("response", None) - if request and request.headers.get("Cache-Control") == "no-store": + if request and request.headers.get("Cache-Control") in ("no-store", "no-cache"): return await func(*args, **kwargs) coder = coder or FastAPICache.get_coder() From e62f0117e044ec5749d8b82bf2aaf25d5f555452 Mon Sep 17 00:00:00 2001 From: Lucca Marques Date: Tue, 9 Aug 2022 13:45:53 -0300 Subject: [PATCH 2/2] feat: changelog changes --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 021e393..d765736 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.1 +### 0.1.10 + +- Add `Cache-Control:no-cache` support. + ### 0.1.9 - Replace `aioredis` with `redis-py`.