Skip to content

Commit

Permalink
Increase cache duration (#1705)
Browse files Browse the repository at this point in the history
* Increase cache durations

* Update comment
  • Loading branch information
jonkafton authored Oct 17, 2024
1 parent 85d46d5 commit 861c127
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions frontends/main/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,19 @@ const nextConfig = {

async headers() {
return [
/* This is intended to target the base HTML responses. Some are dynamically rendered,
* so Next.js instructs no-cache, however we are currently serving public content that
* is cacheable. Excludes everything with a file extension so we're matching only on routes.
/* This is intended to target the base HTML responses and streamed RSC
* content. Some routes are dynamically rendered, so NextJS by default
* sets no-cache. However we are currently serving public content that is
* cacheable.
*
* Excludes everything with a file extension so we're matching only on routes.
*/
{
source: "/((?!.*\\.[a-zA-Z0-9]{2,4}$).*)",
headers: [
{
key: "Cache-Control",
value: "s-maxage=120",
value: "s-maxage=1800",
},
],
},
Expand All @@ -58,7 +61,7 @@ const nextConfig = {
headers: [
{
key: "Cache-Control",
value: "s-maxage=600",
value: "s-maxage=31536000",
},
],
},
Expand Down

0 comments on commit 861c127

Please sign in to comment.