manifest icons: per-build version query — PWA icon URLs are cached 48h by the phone and remove/re-add does not clear that cache, so launchers kept rendering the previous build's icon bytes

This commit is contained in:
Nathan Schneider committed 2026-10-22 13:32:05 -06:00
1 parent 077e6141b3
commit 17e7c92ece
1 file changed
+14 -7
+14 -7
View File
@@ -69,14 +69,21 @@ try:
mf["description"] = "Member-governed AI inference — private and renewable model choices." mf["description"] = "Member-governed AI inference — private and renewable model choices."
# Deterministic icon list: explicit any/maskable entries (no dual-purpose # Deterministic icon list: explicit any/maskable entries (no dual-purpose
# values — some Firefox Android versions mishandle "any maskable"), and # values — some Firefox Android versions mishandle "any maskable"), and
# the launcher-suitable sizes first. # the launcher-suitable sizes first. Each src carries a per-build version
# query: PWA icon URLs are served with max-age=172800, and removing/re-adding
# the PWA does NOT clear the phone's HTTP cache — without the query, launchers
# keep rendering the PREVIOUS build's icon bytes ("my icon never changes").
ver = str(int(time.time()))
def _v(src: str) -> str:
return f"{src}?v={ver}"
mf["icons"] = [ mf["icons"] = [
{"src": "assets/icon-192x192.png", "sizes": "192x192", "type": "image/png", "purpose": "any"}, {"src": _v("assets/icon-192x192.png"), "sizes": "192x192", "type": "image/png", "purpose": "any"},
{"src": "assets/maskable-icon.png", "sizes": "512x512", "type": "image/png", "purpose": "any"}, {"src": _v("assets/maskable-icon.png"), "sizes": "512x512", "type": "image/png", "purpose": "any"},
{"src": "assets/maskable-icon.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable"}, {"src": _v("assets/maskable-icon.png"), "sizes": "512x512", "type": "image/png", "purpose": "maskable"},
{"src": "assets/apple-touch-icon-180x180.png", "sizes": "180x180", "type": "image/png"}, {"src": _v("assets/apple-touch-icon-180x180.png"), "sizes": "180x180", "type": "image/png"},
{"src": "assets/favicon-32x32.png", "sizes": "32x32", "type": "image/png"}, {"src": _v("assets/favicon-32x32.png"), "sizes": "32x32", "type": "image/png"},
{"src": "assets/favicon-16x16.png", "sizes": "16x16", "type": "image/png"}, {"src": _v("assets/favicon-16x16.png"), "sizes": "16x16", "type": "image/png"},
] ]
open(MPATH, "w", encoding="utf-8").write(_json.dumps(mf, indent=2)) open(MPATH, "w", encoding="utf-8").write(_json.dumps(mf, indent=2))
print("manifest: co-op identity set") print("manifest: co-op identity set")