Keep variant content types in memory for cache hits (closes #70)
check / check (push) Successful in 14s
check / check (push) Successful in 14s
Cache.metaCache was declared and never used, so every cache hit read and parsed the variant's .meta file. It is now an LRU (github.com/hashicorp/golang-lru/v2) of up to 10,000 variants' content types, filled by StoreVariant and by a read of a .meta file, so a hit for a variant it holds skips the .meta read. Only a type from a .meta file or a store ever enters memory, never the application/octet-stream fallback, and a stored type is never replaced by an older one from disk. The variant file itself is still opened on every hit, so nothing is served from memory alone. Model: opus-5-5
This commit was merged in pull request #157.
This commit is contained in:
@@ -14,6 +14,7 @@ require (
|
||||
github.com/go-chi/httprate v0.16.0
|
||||
github.com/gorilla/csrf v1.7.3
|
||||
github.com/gorilla/securecookie v1.1.2
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||
github.com/prometheus/client_golang v1.23.2
|
||||
github.com/slok/go-http-metrics v0.13.0
|
||||
github.com/spf13/cobra v1.10.2
|
||||
|
||||
Reference in New Issue
Block a user