Closed mac-chaffee closed 3 days ago
Hello @mac-chaffee the change https://github.com/darkweak/storages/pull/17/files#diff-f6400dfc406b7de4482980fec3748055e9bb49739340994735b5ed509a1e49c7L67-R67 should patch your issue you can try it with --with github.com/darkweak/storages/otter/caddy@f6400dfc406b7de4482980fec3748055e9bb49739340994735b5ed509a1e49c7L67 --with github.com/darkweak/storages/otter@f6400dfc406b7de4482980fec3748055e9bb49739340994735b5ed509a1e49c7L67
. Btw that will be so great if picosh uses Souin/cache-handler module.
Hello! I'm trying to understand how to use surrogate keys and can't seem to get it to work by merely following the spec.
My use-case is that I need to associate a group of cached files with a "project ID" so I can purge all files for the project when it is modified. I'm using Caddy and Otter.
Here's my Caddy config (using
github.com/darkweak/souin/plugins/caddy@v1.7.2
)When I want to set a surrogate-key, I include the header in the response in my application code (
web:3000
):But the surrogate key is never saved:
Likewise, purging via the surrogate key I set also does not clear this cache entry.
I searched through the code and is seems like what I'm doing should work, but I may be missing a config value or something: https://github.com/darkweak/souin/blob/2968d51eef04b31925352ac4aaf815ea49f4efbd/pkg/surrogate/providers/common.go#L238
Am I using the feature incorrectly? Or could there be a bug? Happy to provide further info!