Perf: cache Nitro client assets and parallelize client page
CI / check (push) Successful in 31s
CI / release (push) Skipped
CI / deploy (push) Successful in 59s

- Serve /swf and /nitro-assets (~2.8GB) with 7-day Cache-Control plus
  stale-while-revalidate so client opens stop re-fetching hundreds of
  files while asset updates still propagate in the background
- Issue the SSO ticket and the online count query in parallel on the
  client page to shave a round-trip off the critical render path
This commit is contained in:
openhands committed 2026-08-26 15:06:16 +02:00
1 parent e7f70bb429
commit 9d0da5d65a
2 files changed
+34 -8

No files matched your search

+22
View File
@@ -125,6 +125,28 @@ const nextConfig: NextConfig = {
},
],
},
{
// Nitro client payload (~2.8GB across swf/nitro-assets): without
// caching every client open re-downloads hundreds of files.
// Fresh for 7 days, then serve stale + revalidate in background
// so asset updates still propagate without blocking players.
source: "/swf/(.*)",
headers: [
{
key: "Cache-Control",
value: "public, max-age=604800, stale-while-revalidate=2592000",
},
],
},
{
source: "/nitro-assets/(.*)",
headers: [
{
key: "Cache-Control",
value: "public, max-age=604800, stale-while-revalidate=2592000",
},
],
},
{
source: "/images/(.*)",
headers: [{ key: "Cache-Control", value: "public, max-age=86400" }],