cdn-caching

Diagnose Vercel CDN and ISR caching behavior using metrics, logs, and cache headers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Debugging why Vercel-served pages are stale, uncached, or expensive is hard because cache outcomes span multiple layers (CDN, ISR, PPR) and the raw x-vercel-cache status alone cannot explain the cause. This Skill provides a systematic runbook for measuring cache hit rate, attributing misses and bypasses to specific reasons, and controlling ISR revalidation costs. ## Core Features & Use Cases - Cache hit rate analysis: Group vercel.request.count by cache_result, path_type, and route to find where MISS traffic concentrates, excluding BYPASS noise from the calculation. - Per-request diagnosis: Interpret the nine cacheReason values (cold, collapsed, error, draft_mode, prerender_bypass, crawler, stale_time, stale_tag, stale_error) and the three ppr_state values from vercel logs to explain individual request outcomes. - ISR cost control: Measure write units by route, path, and cache_tags to detect hot tags with large blast radius, then shift from time-based to on-demand tag revalidation. - Use Case: Your ISR bill spiked after a CMS webhook change. Use this Skill to group write units by cache_tags, discover a broad blogPost tag invalidating thousands of pages on every edit, and scope invalidation to blogPost:<id> instead. ## Quick Start Ask the agent 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` with a production environment filter. Treat HIT, STALE, and PRERENDER as cache-served, and exclude BYPASS and unset values so non-cacheable traffic does not distort the ratio.

Why is my Vercel page serving stale content?

Stale content usually means stale-while-revalidate is active: check the cacheReason field in `vercel logs` for stale_time (interval elapsed), stale_tag (tag invalidated), or stale_error (regeneration failed). A stale_error indicates a failing revalidation that needs code investigation.

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. Group BYPASS traffic by bot_category and user_agent to confirm the cause.

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.

Does PPR avoid function invocations on Vercel?

No. A PPR route has dynamic holes by definition, so a cached shell hit still invokes the function 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 not exposed to curl responses. Read cacheReason and ppr_state from `vercel logs`, the dashboard Logs panel, or by aggregating metrics with `--group-by ppr_state`.