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
/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=
My cache key template is template {http.request.uri}.
I noticed while testing purging that I am unable to purge from cache only a single key if it contains the questionmark between the url.path and the url.query.
Example url: localhost/v3/viewLog?day=1
Cache key: /v3/viewLog?day=1 (as seen in redis and when I GET the souin api)
Cannot remove by: curl -X PURGE localhost/souin-api/souin//v3/viewLog?day=1 or curl -X PURGE localhost/souin-api/souin/v3/viewLog?day=1
Hoever, if I change the cache key template from {http.request.uri} to {http.request.uri.path}--{http.request.uri.query}, I am able to purge the cache key /v3/viewLog--day=1 by curl -X PURGE localhost/souin-api/souin/v3/viewLog--day=1.
I also tried (unsuccessfully) to escape the questionmark by curl -X PURGE localhost/souin-api/souin/v3/viewLog\?day=1.
What I am missing?
Thank you!
The text was updated successfully, but these errors were encountered:
teodorescuserban
changed the title
Question mark in the key name makes the key stick
Can't purge a specific key if the key name include a question mark
Jan 22, 2025
Actually I re-tested it and it does work if you escape the question mark and enclose the whole url in double quotes like so curl -X PURGE "localhost/souin-api/souin/v3/viewLog\?day=1".
I guess not having to escape the question mark would still be super useful as you can copy paste the request directly.
Hello, I am using souin cache as caddy module.
My cache key template is
template {http.request.uri}
.I noticed while testing purging that I am unable to purge from cache only a single key if it contains the questionmark between the url.path and the url.query.
Example url:
localhost/v3/viewLog?day=1
Cache key:
/v3/viewLog?day=1
(as seen in redis and when IGET
the souin api)Cannot remove by:
curl -X PURGE localhost/souin-api/souin//v3/viewLog?day=1
orcurl -X PURGE localhost/souin-api/souin/v3/viewLog?day=1
Hoever, if I change the cache key template from
{http.request.uri}
to{http.request.uri.path}--{http.request.uri.query}
, I am able to purge the cache key/v3/viewLog--day=1
bycurl -X PURGE localhost/souin-api/souin/v3/viewLog--day=1
.I also tried (unsuccessfully) to escape the questionmark by
curl -X PURGE localhost/souin-api/souin/v3/viewLog\?day=1
.What I am missing?
Thank you!
The text was updated successfully, but these errors were encountered: