Skip to content

Entries cached with ttl=None can answer 304 indefinitely #110

Closed

Description

@allen0099

Problem

With @cache(ttl=None) the entry is stored without expiry. A request whose If-None-Match matches the stored fingerprint gets a 304 without running the handler. After the data changes, a client that keeps revalidating with the old ETag keeps getting 304 until some other request rewrites the entry. Entries also never expire, so query-string variants accumulate without bound on the Memory backend.

Proposal

For ttl=None, render and compare (the no_cache path) instead of answering 304 from the stored fingerprint, or do not store at all. At minimum document both effects in HTTP_CACHING.md.

Changes behaviour but no API; to be decided whether it counts as a fix.

Activity

  1. added this to the 0.3.8 milestone on Sep 25, 2026
  2. added
    bugSomething isn't working
    http-cacheThe @cache decorator, cache keys and Cache-Control handling
    on Sep 25, 2026
  3. added 3 commits that reference this issue on Sep 26, 2026
    821c0ba
    a88e20d
    30c6798
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghttp-cacheThe @cache decorator, cache keys and Cache-Control handling

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions