Frameworks Can Now Set Header-Based Cache Bypass Rules on Vercel
Key point
Frameworks can now define header-based cache bypass rules on Vercel, and Next.js 16.5 bypasses the cache for HTML-limited bots only when metadata is missing.
Details
- Frameworks can now define
afterCacheBypassrules to serve or bypass a cached page based on request headers, cached-response headers, or both. - Rules are set through the Build Output API and checked in order. A match bypasses the cache and invokes a function; if no rule matches, Vercel serves the cached page.
- On partially prerendered pages, Next.js 16.5 bypasses the cache for HTML-limited bots only when metadata is missing; upgrading requires no additional configuration.
- On nextjs.org, over 70% of those HTML-limited bot requests are now cache hits. The rules apply only to prerendered pages, not API routes or server-rendered pages.