959 B
959 B
SSR and Caching
Server-side rendering via goja (Go JS runtime) with HTML caching.
Request flow
get_read.jsreceives the request and callslib/ssr-server.js.ssr-server.jsrenders the Svelte app vialib/app.server.jsand injectswindow.__SSR_CACHE__.- On the client,
lib/ssr.jshydrates using the injected cache data. - Rendered HTML is stored in the
ssrcollection with dependency tracking.
Build
- SSR bundle is built via
yarn build:serverand outputs tolib/app.server.js. - The build uses
--banner:js='// @ts-nocheck'to suppress type errors in the generated bundle.
Cache invalidation
clear_cache.jshook invalidates SSR cache entries based on collection dependencies.- When content changes, only SSR entries that depend on the changed collection/entry are cleared.
Route validation
SSR route validation is currently disabled and returns -1 in config.js; update this when enabling SSR per route.