Perf: cache Nitro client assets and parallelize client page
- 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:
1 parent
e7f70bb429
commit
9d0da5d65a
2 files changed
+34
-8
No files matched your search
@@ -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" }],
|
||||
|
||||
Reference in new issue
Block a user