Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

⚡️ Cache the manifest and static icons in the browser (#2438)

Luke Vella9709dea0f76d
diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts
index 96fe29508..0bd8fed77 100644
--- a/apps/web/next.config.ts
+++ b/apps/web/next.config.ts
@@ -120,6 +120,28 @@ const nextConfig: NextConfig = {
},
],
},
+ // Browser-cache the manifest and root icons; without this they default to
+ // `max-age=0, must-revalidate` and are revalidated on every page load.
+ {
+ source: "/manifest.json",
+ headers: [
+ {
+ key: "Cache-Control",
+ value: "public, max-age=86400, stale-while-revalidate=604800",
+ },
+ ],
+ },
+ {
+ // Single-segment root files only, so content-hashed `/_next/static/*`
+ // assets keep their immutable headers.
+ source: "/:file([^/]+\\.(?:ico|png|svg|webp))",
+ headers: [
+ {
+ key: "Cache-Control",
+ value: "public, max-age=604800, stale-while-revalidate=86400",
+ },
+ ],
+ },
];
},
devIndicators: