Keep application/octet-stream out of memory for variants (closes #70)
check / check (push) Successful in 3m30s

VariantStorage.LoadWithMeta now returns an empty content type when the
.meta file is missing or unreadable, and GetVariant serves
application/octet-stream in that case without keeping it in memory.
Memory now only ever holds a content type read from a .meta file or
passed to StoreVariant, so a read that ran before a store wrote the
.meta file can no longer leave the wrong type in memory, however it
interleaves with the store, other reads and eviction.

Model: opus-5-5
This commit is contained in:
2026-09-29 08:28:26 +00:00
parent 8620a46c90
commit de6f5e34ea
4 changed files with 25 additions and 15 deletions
+2 -2
View File
@@ -39,8 +39,8 @@ const tempFilePrefix = ".tmp-"
// to each variant file.
const variantMetaSuffix = ".meta"
// fallbackContentType is recorded when a reconciled variant file has
// no readable .meta sidecar.
// fallbackContentType is the content type given to a variant file that
// has no readable .meta sidecar, when it is served or reconciled.
const fallbackContentType = "application/octet-stream"
// UsageBytes returns the total number of bytes of cache content