headless-caching-strategy

Classify VTEX endpoints for safe CDN and BFF caching with bounded TTLs.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/exilonX/ap2 --skill headless-caching-strategy-exilonx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: headless-caching-strategy
Source: https://github.com/exilonX/ap2/tree/main/.agents/skills/headless-caching-strategy
Command: npx skills add https://github.com/exilonX/ap2 --skill headless-caching-strategy-exilonx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the performance and rate-limit problems of headless VTEX storefronts by guiding which VTEX API responses can be safely cached and how to keep them fresh without risking transactional or personal data leakage.

Core Features & Use Cases

  • Cacheable vs non-cacheable API guidance: Defines what must be cached (public, read-only like Intelligent Search and catalog) and what must never be cached (Checkout, Profile, OMS, Payments, pricing private).
  • Stale-while-revalidate (SWR) freshness model: Recommends serving cached data immediately while refreshing in the background for better perceived performance.
  • TTL + invalidation strategy: Proposes bounded TTLs (typically 2–15 minutes) and event-driven or manual invalidation so catalog and availability changes propagate in time.

Quick Start

Ask an AI to design your headless VTEX caching plan so Intelligent Search and Catalog are cached safely with SWR, while Checkout and other sensitive endpoints are explicitly marked as no-cache.

Frequently Asked Questions about headless-caching-strategy

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

FAQPage Schema
How do I configure VTEX headless caching to avoid API rate limits?

Configure VTEX headless caching by applying bounded TTLs with stale-while-revalidate to public APIs like Intelligent Search and Catalog. This reduces direct API calls and latency, alleviating rate-limit pressure.

Which VTEX API endpoints should never be cached in a headless storefront?

Transactional and personal endpoints like Checkout, Profile, OMS, and Payments must never be cached to prevent personal data leakage. These endpoints require strict no-cache rules and must exclude user identity from cache keys.

What is stale-while-revalidate and how does it work for VTEX Catalog caching?

Stale-while-revalidate serves cached Catalog data immediately while refreshing it in the background. This freshness model improves perceived storefront performance while maintaining bounded TTLs of 2 to 15 minutes.

How do I handle cache invalidation for VTEX headless commerce availability changes?

Handle VTEX cache invalidation by combining bounded TTLs with event-driven or manual invalidation. This ensures catalog and availability changes propagate correctly without risking stale data in the storefront.

Can I use BFF caching for VTEX Intelligent Search without leaking user data?

Yes, you can use BFF caching for VTEX Intelligent Search by classifying endpoints as cache-safe and preventing cache keying by user identity. This maintains privacy while cutting latency for public read-only data.