Browser Substrate & WASM Bootstrap
On this page 7 sections
QSCS automatically loads its browser runtime on eligible HTML pages and enables delta navigation by default. Eligible HTML responses receive the loader directly from QSCSCore, so the application does not need template changes or nginx sub_filter. Browser delta navigation is enabled by default for each origin.
Your backend can be written in any language. The injected JavaScript and WebAssembly run in the user’s browser; you do not need Node.js or application-side JavaScript to serve eligible HTML. Explicit signed API requests use the browser helpers described in Configuring Gated Identity. Native and server clients use the HTTP signing contract instead of this browser runtime.
What the substrate does
A service worker fetches pages through QSCS and uses WebAssembly to reconstruct compressed responses before the browser renders them. Links, page scripts, forms and browser history retain their normal document behaviour. The first visit loads the complete page; later visits to the same URL can transfer only changes, or an empty body when unchanged. A different URL needs its own initial baseline.
The worker always contacts the server. It does not provide an offline page cache or replay an old page when the network fails. HEADLESS delivery remains a server decision. Baselines are held in bounded memory, isolated by browsing context, and are discarded on authentication or mutation requests.
Browser runtime
The qscs-bootstrap package supplies the navigation loader, worker and qscs-substrate.wasm. QSCS serves them under /.qscs/browser/ for registered origins. The same package installs identity, API delta and streaming helpers in /opt/qscs/helpers, served under /.qscs/helpers/. The injected client exposes qscs.ready, qscs.fetch, qscs.subscribe and qscs.createSession; no separate browser files are required.
Automatic injection and origin settings
In the control panel, open Infrastructure → Manage domain → Edit origin settings. Browser delta navigation is on by default. Turn it off if the application has a compatibility issue; the setting propagates with the domain configuration. Existing native workers stop using deltas when they receive the updated policy.
[Origins]
www.example.com = 127.0.0.1:8080 BrowserNavigation=on
app.example.com = 127.0.0.1:8081 BrowserNavigation=off
Injection applies to complete, successful HTML documents with a head element. QSCS leaves APIs, downloads, partial responses, encoded responses it cannot transform and Cache-Control: no-transform responses unchanged. The Delta=off setting also disables browser navigation.
HTTPS and security requirements
Serve the site over HTTPS and route /.qscs/browser/ and /.qscs/helpers/ through QSCS, alongside the origin's page requests. Response-body substitution is not required. The worker endpoint supplies Service-Worker-Allowed: /; preserve this header so it can handle navigation throughout the origin.
QSCS preserves Content Security Policy. Policies that block the loader, workers or WebAssembly leave ordinary navigation available. Existing application service workers are not replaced automatically. Signed identity requests keep their existing transport and verification; automatic navigation does not authenticate a user or replace the identity-gate integration.
Verify browser navigation
- Open an eligible page and check that its HTML contains the loader at
/.qscs/browser/loader.js. - Check that
/.qscs/browser/config.jsonreportsenabled: true, and that the worker and WASM requests succeed. - After the worker takes control, visit the same public URL again. Requests can carry
X-QSCS-Delta: 1and a baseline hash; responses report full, incremental or nochange transfer behaviour.
Runtime endpoints
| Path | Purpose |
|---|---|
/.qscs/browser/config.json | Current origin policy. |
/.qscs/browser/loader.js | Automatic worker registration. |
/.qscs/browser/navigation-worker.js | Native document navigation and reconstruction. |
/.qscs/browser/qscs-substrate.wasm | Delta decoder. |
/.qscs/helpers/client.js | Automatically injected identity and API client; loads its package-managed modules as needed. |
Behaviour and compatibility
- Initial visits and first visits to different URLs need full responses. Savings depend on repeat visits and how much the page changes.
- Private, no-store and cookie-setting responses do not become navigation baselines. API/authentication routes, query-string routes and non-GET requests retain normal handling.
- Missing runtime assets, unsupported browsers, restrictive security policies or an existing application worker can prevent acceleration. Ordinary navigation remains available.
- An invalid or mismatched delta triggers one full-response retry. Authentication failures are not bypassed.