Service worker keeps every old build forever #241
Labels
No labels
area/ci
area/desktop
area/packaging
area/protocol
area/reading
area/ui
area/web
area/writing
kind/bug
kind/feature
kind/infra
kind/request
needs/user
parked
perf
security
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
littlefox/neokom#241
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in the performance review (#230, D-058).
app/public/sw.jsstores every hashed build file (wasm, js, css) in the cacheneokom-shell-v1the first time it is fetched, and never removes old ones. The cache name doesn't change between versions, soactivatedoesn't clean them either.Every release, and every rebuild on the home container, adds another ~4.5 MB of wasm (#231) to the browser's storage on each device. With Kubernetes autorolling each release, phones collect old versions until the browser evicts the site for quota.
Fix:
activate(or after the page has loaded), delete the cachedassets/entries that the currentindex.htmldoesn't reference.activate's existing cleanup drops old ones.Merged in #258; main run #426 green. Verified: the new PWA test plants an older wasm in the cache and checks only the current one is kept after a reload; it failed without the change. Desktop and Android (WebKit skips service workers on http loopback).