Improve page load times and rendering

This commit is contained in:
adilallo
2026-05-26 06:59:52 -06:00
parent 6b45a2e5d0
commit 3be188a3cc
29 changed files with 467 additions and 176 deletions
+13 -1
View File
@@ -29,7 +29,7 @@ const nextConfig = {
// Image optimization
images: {
formats: ["image/webp", "image/avif"],
minimumCacheTTL: 60,
minimumCacheTTL: 31536000,
dangerouslyAllowSVG: true,
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
remotePatterns: [
@@ -70,6 +70,18 @@ const nextConfig = {
},
],
},
{
// Long-cache static marketing art (avatars, vectors, case-study, etc.)
// since the file content is hashed into the URL by Next at request time
// through the image optimizer for raster, and changes require a deploy.
source: "/assets/:path*\\.(svg|png|webp|avif|jpg|jpeg)",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
];
},
webpack(config, { dev, isServer }) {