Skip to content

fix(server): honor static freshness validators#2715

Open
Boyeep wants to merge 6 commits into
cloudflare:mainfrom
Boyeep:fix/static-conditional-requests
Open

fix(server): honor static freshness validators#2715
Boyeep wants to merge 6 commits into
cloudflare:mainfrom
Boyeep:fix/static-conditional-requests

Conversation

@Boyeep

@Boyeep Boyeep commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • honor Cache-Control: no-cache instead of returning an immediate 304 for matching validators
  • support If-Modified-Since at HTTP-date precision
  • preserve RFC precedence: If-None-Match overrides If-Modified-Since
  • keep cached and filesystem fallback static paths behaviorally identical

Stack

This is intentionally stacked on #2711 (Last-Modified and range support) and includes #2710 (weak If-None-Match comparison). Those commits will disappear from this PR's diff as the dependencies merge and the branch is rebased.

Next.js parity

Next.js static serving delegates freshness evaluation to its compiled send/fresh stack, which honors no-cache, ETag precedence, and modification dates.

Test plan

  • pnpm test tests/http-conditional.test.ts tests/http-range.test.ts tests/static-file-cache.test.ts tests/serve-static.test.ts (98 passed)
  • staged vp check --fix passed

@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@2715
npm i https://pkg.pr.new/create-vinext-app@2715
npm i https://pkg.pr.new/@vinext/types@2715
npm i https://pkg.pr.new/vinext@2715

commit: 8e0cac7

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

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

0 improved · 1 regressed · 5 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.80 s 2.89 s 🔴 +3.1%
Production build time vinext 3.09 s 3.08 s ⚫ -0.4%
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

@Boyeep
Boyeep force-pushed the fix/static-conditional-requests branch from ba20d9b to b66e664 Compare July 26, 2026 16:39
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