fix: report disk size instead of gzip transfer size - #33
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was no caching bug. Correcting my own diagnosis from #31.
The panel reported 19 MB after a download and I read that as "the models are cached and the WASM is not" — 19 MB happens to match the models exactly. It does not. GitHub Pages gzips everything, and
report()was summingContent-Length, which is the compressed size:19.17 MB. Everything was cached the whole time, WASM included. Two correct numbers, wrongly paired: the prose quoted the uncompressed size and the figure measured the compressed one.
What changes
The panel is titled espacio en el dispositivo, and the Cache API stores bodies decompressed, so it now measures the body rather than reading a header. That costs a pass over ~30 MB on a panel opened by hand, which is fine.
The copy gives both numbers, since both matter and for different reasons: 19 MB de descarga, 30 MB en el dispositivo. One is the data plan, the other is the phone.
One real flaw, found on the way
warm()advanced its progress counter on every attempt rather than every success, so a download where nothing was stored would still report "7 de 7". It now counts only files genuinely in the cache and throws if any failed — which is what would have told me immediately that this was never a caching problem.The work in #31 stands on its own regardless: caching the engine explicitly is more reliable than hoping to intercept MediaPipe, and the malformed SIMD probe it fixed was a genuine bug that validated as
falseon every runtime.