Version static asset URLs so releases bust the CSS/JS cache
Cached app.css from before 0.4.0 left the score keeper page unstyled on phones. Assets are now /static/x?v=<version> with a one-year immutable cache; unversioned requests get 60s. Release 0.4.2. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01MB7nCCAscYsb3zzkT6LHZi
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ const staticRoot = join(here, 'public');
|
||||
const server = createServer(async (req, res) => {
|
||||
const url = new URL(req.url, 'http://x');
|
||||
try {
|
||||
if (url.pathname.startsWith('/static/')) return await serveStatic(res, staticRoot, url.pathname.slice('/static'.length));
|
||||
if (url.pathname.startsWith('/static/')) return await serveStatic(res, staticRoot, url.pathname.slice('/static'.length), url.searchParams.has('v'));
|
||||
const m = router.match(req.method, url.pathname);
|
||||
if (!m) throw new HttpError(404, 'Not found');
|
||||
await m.handler(req, res, m.params);
|
||||
|
||||
Reference in New Issue
Block a user