Skip to content

Commit 67b2978

Browse files
committed
site: vary on Accept via vercel.json so caches don't cross-pollute
Middleware sets `Vary: Accept` but Next's prerender cache strips it on the way out, even on Vercel. Vercel's platform-level headers config applies after the cache, so the header makes it onto every response. Plugs the upstream-proxy concern noted in #623: a cache between the client and Vercel could otherwise key only on URL and serve a markdown response back to a browser (or vice versa).
1 parent f72e56d commit 67b2978

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

vercel.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"headers": [
3+
{
4+
"source": "/",
5+
"headers": [{ "key": "Vary", "value": "Accept" }]
6+
},
7+
{
8+
"source": "/blog",
9+
"headers": [{ "key": "Vary", "value": "Accept" }]
10+
},
11+
{
12+
"source": "/blog/:slug",
13+
"headers": [{ "key": "Vary", "value": "Accept" }]
14+
}
15+
]
16+
}

0 commit comments

Comments
 (0)