Skip to content

caddy ignores no-cache and serves cached response #135

Description

@subnix

If a response contains ETag and Cache-Control with no-cache, caddy ignores no-cache and serves cached response with default ttl without validation.

Reproduction steps:

 {
     log
     cache
 }

 http://localhost:80 {
     log
     cache
     reverse_proxy http://localhost:81
 }

 http://localhost:81 {
     log
     header ETag "\"3e25960a79dbc69b674cd4ec67a72c62\""
     header Cache-Control "no-cache"
     respond "Hello world"
 }
$ curl -i localhost:80
HTTP/1.1 200 OK
Cache-Control: no-cache
Cache-Status: Souin; fwd=uri-miss; stored; key=GET-http-localhost-/
....

$ curl -i localhost:80
HTTP/1.1 200 OK
Age: 11
Cache-Control: no-cache
Cache-Status: Souin; hit; ttl=109; key=GET-http-localhost-/; detail=DEFAULT
...
caddy version
v2.10.2 h1:g/gTYjGMD0dec+UgMw8SnfmJ3I9+M2TdvoRL/Ovu6U8=

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions