Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions .changeset/large-ligers-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@opennextjs/aws": patch
---

fix: add vary header to cache interceptor
4 changes: 4 additions & 0 deletions packages/open-next/src/core/routing/cacheInterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import { generateMessageGroupId } from "./queue";
const CACHE_ONE_YEAR = 60 * 60 * 24 * 365;
const CACHE_ONE_MONTH = 60 * 60 * 24 * 30;

const VARY_HEADER =
"RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch";

async function computeCacheControl(
path: string,
body: string,
Expand Down Expand Up @@ -127,6 +130,7 @@ async function generateResult(
...cacheControl,
"content-type": type,
...cachedValue.meta?.headers,
vary: VARY_HEADER,
},
};
}
Expand Down
Loading