Static files sent with Cache-Control: no-cache (revalidated, a 304 when unchanged): unversioned /vendor modules were cached heuristically, so a tablet kept the old mdi.mjs after the deploy that added the lock icons and the new icons.js failed to import from it, leaving a blank map
CI / check (push) Successful in 18s
CI / deploy (push) Successful in 18s

This commit is contained in:
randy committed 2026-11-18 23:24:15 +01:00
1 parent f09216b102
commit a21e2b0bc6
2 files changed
+16

No files matched your search

+7
View File
@@ -54,6 +54,13 @@ module Maptool
class App < Sinatra::Base
set :public_folder, File.join(__dir__, "public")
# Revalidate every static file (a cheap 304 when unchanged): /js and
# /css are cache-busted by ASSET_VERSION below, but the /vendor modules
# they import (mdi.mjs, nps-symbols.mjs, ...) aren't versioned — with no
# Cache-Control a browser caches them heuristically for hours, and a
# deploy that adds an export there (mdi.mjs gaining a new icon) left a
# tablet with new icons.js + stale mdi.mjs: a failed import, a blank map.
set :static_cache_control, [:no_cache]
# The PWA manifest (public/manifest.webmanifest) — Rack doesn't know
# this extension and would serve it as application/octet-stream.
mime_type :webmanifest, "application/manifest+json"