cache-handler
cache-handler copied to clipboard
Souin api not working
After configuring this in caddy (following the simplest example), I can see it caching, and I see cache hits in headers, yet when I call the api to list cached keys I always get an empty array:
Flushing the cache also doesn't seem to do anything, it keeps serving cached results.
cache-status: Souin; hit; ttl=3536; key=GET-https-example.com-/; detail=DEFAULT
curl "http://localhost:2019/souin-api/souin"
[]
2025/11/20 02:17:03.336 DEBUG http.handlers.cache Incomming request &{Method:GET URL:/ Proto:HTTP/2.0 ProtoMajor:2 ProtoMinor:0 Header:map[Accept:[*/*] User-Agent:[curl/8.7.1]] Body:0xc0000a85a0 GetBody:<nil> ContentLength:0 TransferEncoding:[] Close:false Host:example.com Form:map[] PostForm:map[] MultipartForm:<nil> Trailer:map[] RemoteAddr:192.168.1.5:55788 RequestURI:/ TLS:0xc000604240 Cancel:<nil> Response:<nil> Pattern: ctx:0xc0000a8990 pat:<nil> matches:[] otherValues:map[]}
2025/11/20 02:17:03.336 DEBUG http.handlers.cache Request cache-control &{MaxAge:-1 MaxStale:-1 MaxStaleSet:false MinFresh:-1 NoCache:false NoStore:false NoTransform:false OnlyIfCached:false StaleIfError:0 Extensions:[]}
2025/11/20 02:17:03.340 DEBUG http.handlers.cache The stored key GET-https-example.com-/ matched the current iteration key ETag &{Matched:true IfNoneMatchPresent:false IfMatchPresent:false IfModifiedSincePresent:false IfUnmodifiedSincePresent:false IfUnmotModifiedSincePresent:false NeedRevalidation:false NotModified:false IfModifiedSince:0001-01-01 00:00:00 +0000 UTC IfUnmodifiedSince:0001-01-01 00:00:00 +0000 UTC IfNoneMatch:[] IfMatch:[] RequestETags:[] ResponseETag:}
2025/11/20 02:17:03.340 DEBUG http.handlers.cache Found at least one valid response in the DEFAULT storage
2025/11/20 02:17:03.340 DEBUG http.handlers.cache Serve from cache &{Method:GET URL:/ Proto:HTTP/2.0 ProtoMajor:2 ProtoMinor:0 Header:map[Accept:[*/*] Date:[Thu, 20 Nov 2025 02:17:03 UTC] User-Agent:[curl/8.7.1]] Body:0xc0000a85a0 GetBody:<nil> ContentLength:0 TransferEncoding:[] Close:false Host:example.com Form:map[] PostForm:map[] MultipartForm:<nil> Trailer:map[] RemoteAddr:192.168.1.5:55788 RequestURI:/ TLS:0xc000604240 Cancel:<nil> Response:<nil> Pattern: ctx:0xc0000a9260 pat:<nil> matches:[] otherValues:map[]}
2025/11/20 02:17:09.153 INFO admin.api received request {"method": "GET", "host": "localhost:2019", "uri": "/souin-api/souin", "remote_ip": "127.0.0.1", "remote_port": "50058", "headers": {"Accept":["*/*"],"User-Agent":["curl/8.14.1"]}}