Keep application/octet-stream out of memory for variants (closes #70)
check / check (push) Successful in 3m30s
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user