perf: fix PageSpeed Insights issues (WebGL errors, bfcache, redirects, a11y)
All checks were successful
Gitea CI / test-build (push) Successful in 11m38s
All checks were successful
Gitea CI / test-build (push) Successful in 11m38s
- Add WebGL support detection in ShaderGradientBackground to prevent console errors - Add .catch() fallback to ShaderGradientBackground dynamic import - Remove hardcoded aria-label from consent banner minimize button (fixes label-content-name-mismatch) - Use rewrite instead of redirect for root locale routing (eliminates one redirect hop) - Change n8n API cache headers from no-store to no-cache (enables bfcache) - Add three and @react-three/fiber to optimizePackageImports for better tree-shaking Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -34,7 +34,7 @@ const nextConfig: NextConfig = {
|
||||
experimental:
|
||||
process.env.NODE_ENV === "production"
|
||||
? {
|
||||
optimizePackageImports: ["lucide-react", "framer-motion"],
|
||||
optimizePackageImports: ["lucide-react", "framer-motion", "three", "@react-three/fiber"],
|
||||
}
|
||||
: {
|
||||
// In development, enable webpack build worker for faster builds
|
||||
@@ -167,12 +167,12 @@ const nextConfig: NextConfig = {
|
||||
],
|
||||
},
|
||||
{
|
||||
// Only prevent caching for real-time/sensitive API routes
|
||||
// Allow bfcache for n8n routes: use no-cache (revalidate) instead of no-store
|
||||
source: "/api/n8n/(.*)",
|
||||
headers: [
|
||||
{
|
||||
key: "Cache-Control",
|
||||
value: "no-store, no-cache, must-revalidate, proxy-revalidate",
|
||||
value: "no-cache, must-revalidate",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user