Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Souin api not working

Đang mở
#133 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
go
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu bằng cách tái tạo cấu hình Caddy đơn giản nhất, sau đó gọi /souin-api/souin và thực hiện thao tác xóa cache trong khi so sánh các header cache-hit và log debug. Hoàn tất khi API liệt kê khóa đã được cache và thao tác xóa ngăn các yêu cầu tiếp theo được phục vụ từ cache đó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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"]}}
Ngôn ngữ chính
Go
Star
396
Fork
29
Merge trung bình
32 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của caddyserver/cache-handler

Tất cả issue của caddyserver/cache-handler

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.