cdn-caching

Diagnose Vercel CDN cache hit rates, stale content, revalidation behavior, and ISR costs.

Updated Sep 5, 2026
One-click install
npx skills add https://github.com/dsgalkar/dnyaneshwar_portfolio --skill cdn-caching-dsgalkar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cdn-caching
Source: https://github.com/dsgalkar/dnyaneshwar_portfolio/tree/main/.agents/plugins/vercel/skills/cdn-caching
Command: npx skills add https://github.com/dsgalkar/dnyaneshwar_portfolio --skill cdn-caching-dsgalkar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Debugging why Vercel-served pages are stale, missing the cache, or generating unexpected ISR bills is hard because cache behavior spans multiple layers (CDN, ISR, PPR) and the raw metrics lump different causes together. This Skill provides a systematic runbook for measuring cache hit rate, explaining per-request cache outcomes, and reducing ISR spend. ## Core Features & Use Cases - Cache hit rate analysis: Group vercel.request.count by cache_result, path_type, and route to find where misses concentrate, excluding BYPASS traffic for an accurate ratio. - Per-request cache reasoning: Interpret cacheReason values (cold, collapsed, draft_mode, stale_tag, stale_error, etc.) and ppr_state to explain exactly why a request was a MISS, STALE, or BYPASS. - ISR cost reduction: Measure write units, compute write utilization, identify hot cache tags with large blast radius, and shift from time-based to tag-based revalidation. - Use Case: Your Next.js site's ISR bill spiked. Use this Skill to group write units by cache_tags, discover a broad blogPost tag invalidated by a CMS webhook on every event, and replace it with granular blogPost:<id> tags. ## Quick Start Ask the assistant to analyze why your Vercel site's cache hit rate is low and which routes are driving ISR write costs.

Frequently Asked Questions about cdn-caching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check my Vercel cache hit rate?

Run vercel metrics vercel.request.count grouped by cache_result for your team and project, filtered to production. Treat HIT, STALE, and PRERENDER as cache-served and exclude BYPASS and unset values when computing the hit rate over cacheable traffic.

Why is my Vercel page serving stale content?

Stale responses come from stale-while-revalidate behavior after a time-based interval elapses (stale_time) or a tag invalidation (stale_tag). Check the cacheReason field in vercel logs to see which trigger fired and whether revalidation is failing (stale_error).

What does x-vercel-cache BYPASS mean?

BYPASS means caching was skipped for that request, commonly due to Draft Mode, a prerender-bypass cookie, SEO crawler user agents, no-store or private cache headers, cookies, or uncacheable request methods. Draft Mode and crawler bypasses are expected behavior, not misconfiguration.

How do I reduce Vercel ISR costs?

ISR cost is driven by write units from revalidation, so prefer on-demand tag-based invalidation over short time-based intervals and scope tags to specific IDs like product-<id>. Group write units by cache_tags to find broad tags with a large blast radius that regenerate many routes at once.

Does PPR avoid function invocations on Vercel?

No. A Partial Prerendering route has dynamic holes by definition, so even on a cached shell hit the function still runs to render the postponed content. Only a route with no holes serves as a pure prerender HIT without invoking the function.

Why is the x-vercel-cache-reason header not visible in curl?

The x-vercel-cache-reason and x-vercel-ppr-state headers are internal-only and stripped from client responses. Read cacheReason and ppr_state from vercel logs with --request-id, the dashboard Logs panel, or aggregate them via vercel metrics.