Skip to content

fix(server): use weak comparison for If-None-Match#2710

Open
Boyeep wants to merge 2 commits into
cloudflare:mainfrom
Boyeep:fix/weak-etag-validation
Open

fix(server): use weak comparison for If-None-Match#2710
Boyeep wants to merge 2 commits into
cloudflare:mainfrom
Boyeep:fix/weak-etag-validation

Conversation

@Boyeep

@Boyeep Boyeep commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

What changed

  • extract conditional ETag matching into a focused HTTP helper
  • use weak comparison for If-None-Match, as required by RFC 9110
  • handle comma-separated validators and whitespace around *

Why

The production static server previously compared entity tags as exact strings. A strong validator and weak validator with the same opaque tag therefore failed to match, causing a full 200 response instead of 304 Not Modified.

Impact

Static conditional requests now match standard HTTP and Next.js behavior, avoiding unnecessary asset transfers without changing entity-tag case sensitivity.

Validation

  • vp test run tests/http-conditional.test.ts
  • vp check tests/http-conditional.test.ts packages/vinext/src/server/http-conditional.ts packages/vinext/src/server/prod-server.ts

@pkg-pr-new

pkg-pr-new Bot commented Jul 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@2710
npm i https://pkg.pr.new/create-vinext-app@2710
npm i https://pkg.pr.new/@vinext/types@2710
npm i https://pkg.pr.new/vinext@2710

commit: 932bfc8

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 932bfc8 against base 05eee9f using alternating same-runner rounds. Next.js was unchanged and skipped.

0 improved · 0 regressed · 6 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 132.4 KB 132.4 KB ⚫ -0.0%
Client entry size (gzip) vinext 119.7 KB 119.7 KB ⚫ -0.0%
Dev server cold start vinext 2.95 s 2.93 s ⚫ -0.8%
Production build time vinext 3.08 s 3.05 s ⚫ -1.0%
RSC entry closure size (gzip) vinext 103.3 KB 103.3 KB ⚫ -0.0%
Server bundle size (gzip) vinext 177.8 KB 177.8 KB ⚫ -0.0%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant