Next.js

Next.js: Caching Improvements and Router Fixes

The Next.js team merged 10 pull requests focused on session-dependent task optimization, HTTP cache control implementation, and router query corruption fixes. A React upgrade and test stability improvements were also included.

Duration: PT2M6S

https://podlog.io/listen/next-js-36fde2ae/episode/next-js-caching-improvements-and-router-fixes-f735cf8b

Transcript

Good morning, this is your Next.js developer briefing for May 14th, 2026.

Luke Sandberg merged a significant refactor to simplify session-dependent tasks, converting runtime flags to compile-time attributes for better performance. This enables eager aggregation number selection and removes the need for runtime session dependency marking.

Sandberg also merged improvements to fetch behavior, implementing proper HTTP Cache-Control header support with TTL-based invalidation. The new system uses a two-task pattern where fetch_inner performs HTTP requests while fetch handles session-dependent caching with proper timeout handling.

Hendrik Liebau fixed a router query corruption bug affecting Pages Router apps that combine basePath, rewrites, middleware, and catch-all routes. The issue caused router.query to contain internal URL segments instead of actual route parameters.

Liebau also improved error handling for use cache components, surfacing invalid dynamic usage errors through Flight in development instead of falling back to the Pages Router error page. A follow-up PR enhanced nested cache error reporting by showing the inner cache call site as the error cause.

The Vercel Release Bot upgraded React from build dd453071 to d5736f09, bringing in upstream improvements across 62 files.

Liebau resolved test flakiness by patching playwright-core to properly resolve request promises on failure, allowing previously skipped cached-navigation tests to run reliably again.

Janka Uryga made maintenance fixes, renumbering non-sequential error codes and resolving GNU xargs compatibility warnings in the build scripts.

What's next: The team continues work on caching system optimizations and improved developer experience for cache-related errors.

That's your Next.js update for today. We'll be back tomorrow with more developments.