cdn-caching

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

Updated Aug 21, 2025
One-click install
npx skills add https://github.com/Adithiya-S/AI-Study-Companion --skill cdn-caching-adithiya-s
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cdn-caching
Source: https://github.com/Adithiya-S/AI-Study-Companion/tree/main/.agents/skills/cdn-caching
Command: npx skills add https://github.com/Adithiya-S/AI-Study-Companion --skill cdn-caching-adithiya-s

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Debugging why pages serve stale content, why requests bypass the cache, or why ISR bills spike is difficult without understanding Vercel's layered caching model. This Skill provides the diagnostic commands and reasoning to pinpoint cache misses, revalidation storms, and cost drivers. ## Core Features & Use Cases - Cache Hit Rate Analysis: Measure cache-served versus origin traffic using vercel metrics grouped by cache_result, excluding BYPASS noise. - Per-Request Diagnosis: Interpret x-vercel-cache status, cacheReason values (cold, collapsed, draft_mode, stale_tag, etc.), and ppr_state to explain exactly why a request missed or went stale. - ISR Cost Control: Quantify read/write units, compute write utilization, and identify hot cache tags with large blast radius driving revalidation spend. - Use Case: Your Next.js site's ISR bill doubled. Use this Skill to group write units by route and cache tag, discover a broad blogPost tag invalidated by a CMS webhook on every edit, and switch to granular blogPost:<id> tags. ## Quick Start Ask the assistant to analyze why my 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. 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 content usually results from stale-while-revalidate behavior after a time-based interval elapsed or a tag invalidation. Check the `cacheReason` field in logs: `stale_time` means scheduled refresh, `stale_tag` means a revalidateTag call, and `stale_error` means regeneration failed.

What does x-vercel-cache BYPASS mean?

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

How do I reduce Vercel ISR costs?

Prefer on-demand tag-based revalidation over short time-based intervals, and scope tags to specific IDs like `product:${id}` instead of broad tags. Group `vercel.isr_operation.write_units` by route and cache_tags to find which paths regenerate most often.

Does PPR avoid function invocations on Vercel?

No. A Partial Prerendering route has dynamic holes by definition, so the cached static shell still invokes the function to fill them per request. Only a holeless route serves as a pure prerender HIT without invoking the function.