Skip to content

Commit 186e28f

Browse files
jadenvconico974
andauthored
fix(open-next): correctly set cache control for html pages (#353)
* fix(open-next): correctly set cache control for html pages * changeset --------- Co-authored-by: conico974 <[email protected]>
1 parent b9eefca commit 186e28f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/wet-brooms-cheer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"open-next": patch
3+
---
4+
5+
fix(open-next): correctly set cache control for html pages

packages/open-next/src/adapters/plugins/routing/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function fixCacheHeaderForHtmlPages(
7474
headers: Record<string, string | undefined>,
7575
) {
7676
// WORKAROUND: `NextServer` does not set cache headers for HTML pages — https://github.com/serverless-stack/open-next#workaround-nextserver-does-not-set-cache-headers-for-html-pages
77-
if (HtmlPages.includes(rawPath) && headers[CommonHeaders.CACHE_CONTROL]) {
77+
if (HtmlPages.includes(rawPath)) {
7878
headers[CommonHeaders.CACHE_CONTROL] =
7979
"public, max-age=0, s-maxage=31536000, must-revalidate";
8080
}

0 commit comments

Comments
 (0)