perf: edge-cache static assets and shrink org-route bundle

The /org/[slug] routes loaded 250+ JS chunks and, after a deploy, every
chunk missed Cloudflare's edge cache and stampeded the single origin (up
to 48s to serve one static file) — the "keeps loading" lockout.

- tenant-router: opt /_app/immutable/* into the edge cache via
  cf.cacheEverything; setting Cache-Control alone never populated it
- course/api: mark the 14 API singletons /* @__PURE__ */ so the barrel
  tree-shakes instead of dragging every API into each importer
- courses page: import directly instead of via the feature barrels

Cuts the courses route from 257 to 225 static chunks and keeps static
assets off the origin after the first edge fill.
This commit is contained in:
Rotimi Best
2026-06-12 01:51:05 +01:00
parent 8fd80e9dc5
commit c868b2f23f
16 changed files with 29 additions and 22 deletions
@@ -328,4 +328,4 @@ export class ExerciseApi extends BaseApiWithErrors {
*/
}
export const exerciseApi = new ExerciseApi();
export const exerciseApi = /* @__PURE__ */ new ExerciseApi();