Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Souin api not working

Aperta
#133 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
go
Ambito
api, backend

Direzione di ricerca

Inizia riproducendo la configurazione Caddy più semplice, quindi chiama /souin-api/souin ed esegui l’operazione di svuotamento della cache confrontando gli header cache-hit e i log di debug. Il lavoro è completato quando l’API elenca la chiave memorizzata nella cache e lo svuotamento impedisce che le richieste successive vengano servite da quella cache.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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"]}}
Lingua principale
Go
Stelle
395
Fork
30
Merge medio
32m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di caddyserver/cache-handler

Tutte le issue di caddyserver/cache-handler

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.