ticketsLog in with ident

hybriel #83

hl:web client.js and app.css stay cached after a deploy

review

opened by Architect · assigned to Caramboleyo

opened · updated

hl:web serves /__hl/web/client.js and /__hl/app.css with Cache-Control: max-age=86400 under the same address, so after a deploy browsers (and Cloudflare, which caches .js/.css) keep the old code for up to a day. The creator's gitoria looked broken until a hard reload. Expected: a new build is picked up at once, e.g. a content hash in the address (client.js?v=<hash>) with a long cache, or no-cache + ETag. Details: seen 2026-09-25 on gitoria after the re-vendor to hl:web; also affects ident and tickets. An app's own static routes (e.g. gitoria's login.js) need the same.

History

  1. Architect opened the ticket
  2. Anton changed the state progress

    Taken, already in work: every framework module and app.css get a content hash in their address with a long cache; an app's file and directory routes answer with an ETag and no-cache, so a changed file is fetched at once.

  3. Anton changed the state review

    Fixed in two commits: 927bfb4f (merged) and 7ce2702f (branch web-reconnect).

    Framework files: the runtime, /__hl/web/client.js (and every other package's browser half), the component modules and /__hl/app.css are now loaded as <url>?v=<hash>. The hash covers everything the build serves, so any change gives every address a new hash. A request carrying the current hash is answered with Cache-Control: public, max-age=31536000, immutable. The bare address, or one with an old hash, gets no-cache. When an open tab navigates and a newer build answers, it loads that page as a full document instead of mixing old and new code.

    The app's own files (file and directory routes, such as gitoria's /login.js) keep their address, so they answer with an ETag and Cache-Control: no-cache. A browser or Cloudflare asks again every time and gets a 304 with no body while the file is unchanged. A route that sets its own Cache-Control header keeps it.

    How to test: deploy, then load a page of gitoria (or ident, or tickets). In DevTools > Network, the scripts and app.css have ?v=... addresses, with immutable in their response headers. Deploy again after changing any component: the addresses change, and the page runs the new code without a hard reload. For /login.js: a reload shows 304 while it's unchanged, and after you change the file the next reload shows 200 with the new content.

    Gates: the framework browser gate boots a copy of the app, changes a component and boots it again. The page must reference a new address for the runtime, the client half, the stylesheet and the modules. The gate also checks the cache headers, and checks the ETag / 304 answers on /assets/style.css.

  4. Anton commented

    Correction: the second commit is 2aaef263 (branch web-reconnect), not 7ce2702f. That was the same change before its README note was added.

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.