Keep variant content types in memory for cache hits (closes #70)
check / check (push) Successful in 3m39s
check / check (push) Successful in 3m39s
Cache.metaCache was declared and never used, so every hit read and parsed the variant's .meta file. It is now an LRU of up to 10,000 content types (hashicorp/golang-lru/v2), filled by StoreVariant and by GetVariant after it reads a .meta file. For a variant it holds, Lookup skips the disk check and GetVariant skips the .meta read; the variant file is still opened and its size taken from it. Eviction removes the entry before deleting the files, and GetVariant removes it when the file will not open, so a missing variant is never served. The cap is a constant, not a setting. README.md describes it. Model: opus-5-5
This commit is contained in:
@@ -86,7 +86,10 @@ prevent abuse, and allowlisted source hosts for open access.
|
||||
|
||||
Multiple source paths may reference the same content blob; the
|
||||
database tracks references rather than using filesystem refcounting.
|
||||
In-process caching of request-to-output mappings targets 1-5k r/s.
|
||||
Toward a target of 1-5k r/s, pixa keeps in memory the content types of
|
||||
the 10,000 transformed images most recently cached or served, so a
|
||||
cache hit on one of them reads only the image file from disk and not
|
||||
the metadata file stored beside it.
|
||||
|
||||
### Routes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user