Skip to content

Purging a key automatically appends an ending wildcard? #596

@teodorescuserban

Description

@teodorescuserban

Hello, I am using souin cache as caddy module.

/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 by accident while providing a partial key. To my surprise, even though I did not put the * at the end, all keys matching that prefix have been removed from cache.

Example:

$ curl -X GET localhost/souin-api/souin/
/v3/viewLog?day=1
/v3/viewLog?day=2
/v3/viewLog?day=3
/v3/viewLog?day=4
/v3/view1d?axis=x

If I try to purge a partial key, all keys [matching the prefix] are being removed:

$ curl -X PURGE localhost/souin-api/souin/v3/viewL
$ curl -X GET localhost/souin-api/souin/
/v3/view1d?axis=x

What I am missing?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions