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
This commit is contained in:
1 parent
f09216b102
commit
a21e2b0bc6
2 files changed
+16
No files matched your search
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user