caddyserver / caddyserver/cache-handler

Souin api not working

Open
#133 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
393
Forks
28
Avg merge
32m
Merged PRs (30d)
1

Description

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"]}}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the simplest Caddy configuration, then call /souin-api/souin and exercise the cache-flushing operation while comparing the cache-hit headers and debug logs. Done means the API lists the cached key and flushing prevents subsequent requests from being served from that cache.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.