[PR #91] [MERGED] fix: add Vary header to SSR and RSC responses #301

Closed
opened 2026-05-06 12:39:04 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/91
Author: @southpolesteve
Created: 2/26/2026
Status: Merged
Merged: 2/26/2026
Merged by: @southpolesteve

Base: mainHead: fix/vary-header


📝 Commits (2)

  • 16411fb fix: add Vary: RSC, Accept header to prevent CDN cache poisoning
  • c82e1d5 remove advisory reference from code comment

📊 Changes

2 files changed (+37 additions, -10 deletions)

View changed files

📝 packages/vinext/src/server/app-dev-server.ts (+13 -8)
📝 packages/vinext/src/server/prod-server.ts (+24 -2)

📄 Description

Summary

Adds Vary: RSC, Accept to all page responses to prevent CDN caching issues when the same URL returns different content types based on request headers.

  • app-dev-server.ts: All RSC stream and HTML responses now include Vary: RSC, Accept
  • prod-server.ts: Compression logic merges Accept-Encoding into the existing Vary header instead of overwriting it, preserving the content negotiation values

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/91 **Author:** [@southpolesteve](https://github.com/southpolesteve) **Created:** 2/26/2026 **Status:** ✅ Merged **Merged:** 2/26/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `fix/vary-header` --- ### 📝 Commits (2) - [`16411fb`](https://github.com/cloudflare/vinext/commit/16411fb25b210ed9f3cbc47ccd3179acebeeb4ed) fix: add Vary: RSC, Accept header to prevent CDN cache poisoning - [`c82e1d5`](https://github.com/cloudflare/vinext/commit/c82e1d558dc0ec002a0eec45d9680bbff46fd632) remove advisory reference from code comment ### 📊 Changes **2 files changed** (+37 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/server/app-dev-server.ts` (+13 -8) 📝 `packages/vinext/src/server/prod-server.ts` (+24 -2) </details> ### 📄 Description ## Summary Adds `Vary: RSC, Accept` to all page responses to prevent CDN caching issues when the same URL returns different content types based on request headers. - **app-dev-server.ts**: All RSC stream and HTML responses now include `Vary: RSC, Accept` - **prod-server.ts**: Compression logic merges `Accept-Encoding` into the existing Vary header instead of overwriting it, preserving the content negotiation values --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:04 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#301
No description provided.