fix(web): stop caching the interface modules

Modules cache independently, so a browser could revalidate one and keep an
older copy of another — leaving a page running one version of itself and a
different version of its helpers. That surfaces as an error inside a
feature, which is nothing like what it is, and no reload short of clearing
the site data reliably fixes it.

A dashboard is a handful of small files read by one person at a time: the
bandwidth caching saves is worth less than the failure it causes. They are
now fetched fresh.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
nocodeandClaude Opus 5 committed 2026-09-23 23:20:08 +02:00
1 parent c031b4d9e2
commit 3f4a5709cf
2 files changed
+15 -2

No files matched your search

+7
View File
@@ -95,6 +95,13 @@ describe('dashboard server', () => {
assert.match(response.headers.get('content-type'), /javascript/);
});
it('never lets a module be cached, so versions cannot drift apart', async () => {
for (const path of ['/app.js', '/core/ui.js', '/views/settings.js', '/styles.css']) {
const response = await app.fetch(path);
assert.equal(response.headers.get('cache-control'), 'no-store', `${path} peut être mis en cache`);
}
});
it('gives its assets a validator so a cache can revalidate', async () => {
const response = await app.fetch('/core/dom.js');
assert.ok(response.headers.get('etag'), 'no ETag on a static asset');