You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am using the souin module with caddy and redis (see versions below).
I am using {http.request.uri} as the cache key and everything seems to be running properly.
However, it looks like if the response contains a Vary header, the cache key will also include this header value automatically.
I solved this issue by just adding a headers_down -Vary in the reverse proxy block, but I would really like to pass the response with all headers.
Would it be possible to ignore the Vary header in the cache config?
Thank you!
/etc/caddy # caddy version
v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=
/etc/caddy # caddy build-info | grep souin
dep github.com/darkweak/souin v1.7.5 h1:drNhZc0GhSbGcugiGfcYdLDTcx3DCZW6o13wwRj5o5Y=
/etc/caddy # caddy build-info | grep stora
dep github.com/darkweak/storages/core v0.0.11 h1:IwvpAtkhOmxC5pIffJ8opW6erpTnIi5zqPveiAQs8ew=
dep github.com/darkweak/storages/go-redis v0.0.11 h1:2IjIEPREWyooSAq4syKeFq/yeia5sPnaypzs/GK3tRo=
dep github.com/darkweak/storages/go-redis/caddy v0.0.11 h1:d6qQRAzOJLSmQkLXEW/XVTAkh/C0kofPP3LxoP9djWs=
For example, for this request: /v3/viewSummary?loc=20
the response contains the header: vary: origin,access-control-request-method,access-control-request-headers
and the cache key becomes: /v3/viewSummary?loc=20{-VARY-}origin:;access-control-request-method:;access-control-request-headers:"
This is my cache configuration:
cache {
cache_name cache
allowed_http_verbs GET HEAD
api {
debug
prometheus
souin
}
log_level info
# see https://github.com/darkweak/souin/issues/345#issuecomment-1560574770
mode bypass
ttl 30s # 3h
stale 1s # 72h
timeout {
backend 300s
cache 120s
}
default_cache_control public
key {
template {http.request.uri}
# hash
}
redis {
configuration {
Addrs redis:6379
DB 4
}
}
}
The text was updated successfully, but these errors were encountered:
Hello @teodorescuserban we can introduce a new configuration directive named disable_vary in the key and cache_keys.
That would be awesome, @darkweak!
In the mean time, I'm keeping the headers_down -Vary config.
One note though, I think the disable_* options are skipped if template is being used. This means disable_vary would need a slightly different logic so it remains enabled even if template is used
Hello, I am using the souin module with caddy and redis (see versions below).
I am using
{http.request.uri}
as the cache key and everything seems to be running properly.However, it looks like if the response contains a
Vary
header, the cache key will also include this header value automatically.I solved this issue by just adding a
headers_down -Vary
in the reverse proxy block, but I would really like to pass the response with all headers.Would it be possible to ignore the
Vary
header in the cache config?Thank you!
For example, for this request:
/v3/viewSummary?loc=20
the response contains the header:
vary: origin,access-control-request-method,access-control-request-headers
and the cache key becomes:
/v3/viewSummary?loc=20{-VARY-}origin:;access-control-request-method:;access-control-request-headers:"
This is my cache configuration:
The text was updated successfully, but these errors were encountered: