diff --git a/bun.lockb b/bun.lockb index 73e072f..5a0726e 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/ui/landing/hero-globe.jsx b/components/ui/landing/hero-globe.jsx index b8ca73f..85602b5 100644 --- a/components/ui/landing/hero-globe.jsx +++ b/components/ui/landing/hero-globe.jsx @@ -15,7 +15,7 @@ export default function HeroGlobe() { src={globe} width={880} height={880} - loading="eager" + priority />
diff --git a/components/ui/landing/problem.jsx b/components/ui/landing/problem.jsx index 9d47763..7f52ef1 100644 --- a/components/ui/landing/problem.jsx +++ b/components/ui/landing/problem.jsx @@ -17,7 +17,7 @@ export default function Problem() { luisazhou.com diff --git a/next.config.mjs b/next.config.mjs index aa8ec1f..a844605 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -19,12 +19,44 @@ const nextConfig = { }, async headers() { return [ + // apply cache headers for root static assets { - source: "/(.*)", + source: + "/:file(\\.(txt|xml|json|ico|png|jpg|jpeg|svg|webp|webm|mp4|woff|woff2))$", headers: [ { key: "Cache-Control", - value: "public, max-age=2592000, must-revalidate", // cache for 1 month (2592000 seconds) + value: "public, max-age=2592000, immutable", // immutable cache for 1 month (2592000 seconds) + }, + ], + }, + // apply cache headers for other static assets + { + source: "/(static|media|assets|images|videos|documents)/:path*", + headers: [ + { + key: "Cache-Control", + value: "public, max-age=2592000, immutable", // immutable cache for 1 month (2592000 seconds) + }, + ], + }, + // apply cache headers for next.js static assets + { + source: "/_next/static/:path*", + headers: [ + { + key: "Cache-Control", + value: "public, max-age=2592000, immutable", // immutable cache for 1 month (2592000 seconds) + }, + ], + }, + // apply cache headers for vercel insights static assets + { + source: "/_vercel/insights/:path*", + headers: [ + { + key: "Cache-Control", + value: "public, max-age=2592000, immutable", // immutable cache for 1 month (2592000 seconds) }, ], },