perf: use Redis for favicon cache with 24h TTL
Favicons are now cached in Valkey/Redis instead of an in-memory map: - TTL: 24 hours (up from 1 hour in-memory) - ETag derived from body SHA256 (no extra storage needed) - Falls back to in-memory on cache miss when Valkey is unavailable - GetBytes/SetBytes added to cache package for raw byte storage In-memory faviconCache map, sync.RWMutex, and time-based expiry logic removed from handlers.go.
This commit is contained in:
parent
352264509c
commit
b57a041b6a
4 changed files with 59 additions and 60 deletions
|
|
@ -77,7 +77,7 @@ func main() {
|
|||
|
||||
acSvc := autocomplete.NewService(cfg.Upstream.URL, cfg.HTTPTimeout())
|
||||
|
||||
h := httpapi.NewHandler(svc, acSvc.Suggestions, cfg.Server.SourceURL)
|
||||
h := httpapi.NewHandler(svc, acSvc.Suggestions, cfg.Server.SourceURL, searchCache)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue