491f495c66
- Updated `tibi-project-setup` skill to clarify project initialization goals and steps. - Improved `tibi-ssr-caching` skill to detail SSR architecture, responsibilities, and caching mechanisms. - Introduced `website-solution-architecture` skill for translating website requirements into coherent solutions. - Refined `AGENTS.md` to provide a structured roadmap for project development phases. - Added `ADMIN_ASSET_VERSION` to `api/config.yml.env` for asset versioning. - Updated SSR request flow and cache invalidation logic in `api/hooks/ssr/AGENTS.md`. - Removed obsolete `esbuild.config.admin.js` and integrated asset versioning into the main `esbuild.config.js`. - Adjusted `api/collections/content.yml` to utilize asset versioning for admin scripts.
1.6 KiB
1.6 KiB
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.get_read.jsloadslib/app.server.jsand callsapp.default.render({ url }).frontend/src/ssr.tsstays thin and only initializes locale state before renderingApp.svelte.frontend/src/App.svelteis responsible for actual page data loading for both browser and SSR.- During SSR,
App.sveltecalls the sameloadContent(...)path directly insidetypeof window === "undefined". - Rendered HTML is stored in the
ssrcollection together with dependency tracking strings.
Build
- SSR bundle is built via
yarn build:serverand outputs tolib/app.server.js. - The project no longer uses Babel for SSR.
- goja-compatible transforms are configured in
esbuild.config.server.jsviasupported. - The server build must remove frontend-only splitting/outdir options inherited from the shared esbuild config.
Cache invalidation
clear_cache.jshook invalidates SSR cache entries based on collection dependencies.- Dependencies are stored as strings like
content:<id>orcontent:*. DELETEinvalidation must be robust even whencontext.data.idis missing.
Route validation
- SSR route validation is active in
config.js. - Public page URLs are language-prefixed (
/de/...,/en/...), whilecontent.pathin the DB is stored without that prefix. ssrValidatePath()must strip the language prefix before querying content and return a canonical language-prefixed URL when needed.