Skip to content

docs(design): content-hashed URLs for the browser runtimes (#578) - #627

Merged
JuroOravec merged 2 commits into
mainfrom
design/runtime-hashed-urls
Nov 14, 2026
Merged

JuroOravec merged 2 commits into
mainfrom
design/runtime-hashed-urls

Conversation

@JuroOravec

Copy link
Copy Markdown
Member

Design for review; hold until after 0.8.0 is released.

🤖 Generated with Claude Code

JuroOravec and others added 2 commits November 13, 2026 21:01
Design for serving citry.js and the Events and i18n runtimes from
URLs that contain a hash of their bytes, so browsers can keep them.
Covers the stable aliases, the shared-cache fallback for old hashes,
the reload rule when a runtime is missing, rolling deploys, the
artifacts that change, and the security review routes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… URLs (#578)

Each of the seven open questions in the design is now a decision, and the
sections that depended on the answers follow them:

- URL shape is `citry.<sha256>.js`.
- The shared runtime has one hashed URL, which the Events serialization links
  too, so there is no separate hashed Events route.
- The stable URLs stay in every release.
- A page that answered a request other than GET or HEAD never reloads. The app
  passes the method as `request_method` to `serialize()`, and the server writes
  a `canReload` value into the start script and the configuration JSON.
- A public `Citry.runtime_url()` returns the hashed URL.
- Saving the runtime to the shared cache stays automatic, with a 30-day expiry
  passed through `_store_if_missing`.
- Exporting the i18n runtime in static export is a separate change.

The error modes, the file list, the tests, the spec and plan updates, and the
checks in sections 7 and 9 are updated to match. The pull request stays a
draft that holds until after 0.8.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec

Copy link
Copy Markdown
Member Author

The design doc now records the maintainer's decisions on the seven open questions (commit 2999e07). Section 6 lists them, and the other sections follow them. The PR stays a draft and holds until after 0.8.0.

  1. URL shape is citry.<sha256>.js.
  2. The shared runtime has one hashed URL. The Events serialization links citry.<sha256>.js too, so there is no separate hashed Events route.
  3. The stable URLs (citry.js, ext/events/runtime.js, ext/i18n/runtime.js) stay permanently.
  4. A page that answered a request other than GET or HEAD never reloads when its runtime is missing. The app passes the method as request_method to serialize(). If the app does not pass it, Citry cannot tell and the page may reload.
  5. A public citry.runtime_url() (a method on Citry) returns the hashed URL.
  6. Saving the runtime to the shared cache stays automatic, with a 30-day expiry.
  7. Exporting the i18n runtime in static export is a separate change.

Decision 4 needed one detail the question did not settle: how Citry learns the request method. The doc proposes the request_method keyword, because no Citry adapter renders pages, so only the app's own view sees the request. Say if you want a different way.

@JuroOravec
JuroOravec marked this pull request as ready for review November 14, 2026 13:34
@JuroOravec
JuroOravec merged commit 6e0fb92 into main Nov 14, 2026
10 checks passed
@JuroOravec
JuroOravec deleted the design/runtime-hashed-urls branch November 14, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant