Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions frontends/main/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,46 @@ 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.
*/
Comment on lines +62 to +65
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion is mention RSC here, too.

Suggested change
/* 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",
},
],
},

/* Images rendered with the Next.js Image component have the cache header
* set on them, but CSS background images do not.
*/
{
source: "/images/(.*)",
headers: [
{
key: "Cache-Control",
value: "s-maxage=600",
},
],
},
{
source: "/favicon.ico",
headers: [
{
key: "Cache-Control",
value: "s-maxage=31536000",
},
],
},
]
},

images: {
remotePatterns: [
{
Expand Down
2 changes: 1 addition & 1 deletion frontends/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"api": "workspace:*",
"formik": "^2.4.6",
"lodash": "^4.17.21",
"next": "^14.2.7",
"next": "^14.2.15",
"ol-ckeditor": "0.0.0",
"ol-components": "0.0.0",
"ol-utilities": "0.0.0",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading