diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0d62a1..104eec2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ name: ci -on: [push, pull_request] +on: [ push, pull_request ] jobs: ci: runs-on: ubuntu-latest @@ -8,6 +8,9 @@ jobs: - uses: actions/setup-python@v2 with: python-version: "3.x" - - uses: dschep/install-poetry-action@v1.3 + - name: Install and configure Poetry + uses: snok/install-poetry@v1.1.1 + with: + virtualenvs-create: false - name: CI run: make ci diff --git a/fastapi_cache/decorator.py b/fastapi_cache/decorator.py index 9a8c19b..93d1363 100644 --- a/fastapi_cache/decorator.py +++ b/fastapi_cache/decorator.py @@ -26,6 +26,9 @@ def cache( nonlocal coder nonlocal expire nonlocal key_builder + request = kwargs.get("request") + if request.headers.get("Cache-Control") == "no-store": + return await func(*args, **kwargs) coder = coder or FastAPICache.get_coder() expire = expire or FastAPICache.get_expire()