Cache API silently strips URL fragments, causing chunk overwrites in model storage
A developer discovered that their highest-quality AI model tier had never successfully loaded in production due to a subtle Cache API behavior: URL fragments are stripped during both put and match operations. This meant chunk keys like 'key#0' and 'key#7' were treated as the same cache entry, so each new chunk write overwrote the previous one, leaving only the last-written manifest blob. When the app read the cache, it retrieved the tiny JSON manifest instead of the model and passed it to ONNX Runtime, which correctly rejected it as an invalid protobuf. The fix involved switching from fragment-based keys to path-segment keys and adding a magic-byte plus size-floor validation before passing cached bytes to any parser.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in