diff options
| author | Adam Soltys <[email protected]> | 2026-06-27 10:03:56 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-27 10:03:56 -0700 |
| commit | 58f9c5e8cef7deba3e3054124ba4d2bd992db646 (patch) | |
| tree | afffebf5ca15e5dbaec5d5e9d8c4da3ccd7b41b6 | |
| parent | 00bea1dbd226d065cdfaf7b56af4913324888264 (diff) | |
| parent | 5082edae2a89c202016dc8337ba432aa3409d1ba (diff) | |
| download | coinosv3-58f9c5e8cef7deba3e3054124ba4d2bd992db646.tar.gz coinosv3-58f9c5e8cef7deba3e3054124ba4d2bd992db646.zip | |
Merge branch 'master' into boltz-swaps
| -rw-r--r-- | dev.js | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -8,23 +8,26 @@ const port = Number(process.env.PORT || 5173); Bun.serve({ port, async fetch(req) { + // Never let the browser cache (or bfcache) dev assets — every load rebuilds + // from source, so a stale HTTP cache or restored tab can't pin old code. + const NO_STORE = 'no-store, must-revalidate'; try { const path = new URL(req.url).pathname; if (path === '/jsqr.js') { return new Response(await buildJsQr({ minify: false }), { - headers: { 'content-type': 'text/javascript; charset=utf-8' }, + headers: { 'content-type': 'text/javascript; charset=utf-8', 'cache-control': NO_STORE }, }); } const loc = path.match(/^\/locales\/([a-z]{2})\.json$/); if (loc) { const f = Bun.file('src/locales/' + loc[1] + '.json'); return (await f.exists()) - ? new Response(f, { headers: { 'content-type': 'application/json; charset=utf-8' } }) - : new Response('{}', { status: 404, headers: { 'content-type': 'application/json' } }); + ? new Response(f, { headers: { 'content-type': 'application/json; charset=utf-8', 'cache-control': NO_STORE } }) + : new Response('{}', { status: 404, headers: { 'content-type': 'application/json', 'cache-control': NO_STORE } }); } const html = await buildHtml({ minify: false }); return new Response(html, { - headers: { 'content-type': 'text/html; charset=utf-8' }, + headers: { 'content-type': 'text/html; charset=utf-8', 'cache-control': NO_STORE }, }); } catch (e) { return new Response(`Build error:\n\n${e.stack || e}`, { |
