We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ec12c9 commit 6f7c130Copy full SHA for 6f7c130
.changeset/afraid-trees-bathe.md
@@ -0,0 +1,5 @@
1
+---
2
+"@opennextjs/aws": patch
3
4
+
5
+fix cache control headers for fully static page with base path
packages/open-next/src/core/routing/util.ts
@@ -245,7 +245,9 @@ export function fixCacheHeaderForHtmlPages(
245
// https://opennext.js.org/aws/v2/advanced/workaround#workaround-nextserver-does-not-set-cache-headers-for-html-pages
246
// Requests containing an `x-middleware-prefetch` header must not be cached
247
if (
248
- HtmlPages.includes(localizedPath) &&
+ HtmlPages.find(
249
+ (path) => `${NextConfig.basePath ?? ""}${path}` === localizedPath,
250
+ ) &&
251
!internalEvent.headers["x-middleware-prefetch"]
252
) {
253
headers[CommonHeaders.CACHE_CONTROL] =
0 commit comments