headless-caching-strategy

Generates actionable IT/engineering roadmaps from a single user prompt.

39|9|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/vtex/ai-skills --skill headless-caching-strategy-vtex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: headless-caching-strategy
Source: https://github.com/vtex/ai-skills/tree/main/tracks/headless/skills/headless-caching-strategy
Command: npx skills add https://github.com/vtex/ai-skills --skill headless-caching-strategy-vtex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams implement robust caching strategies for headless VTEX storefronts, ensuring fast, scalable delivery while guarding sensitive data from inappropriate caching.

Core Features & Use Cases

  • Categorizes VTEX APIs into cacheable and non-cacheable groups (CDN edge vs BFF vs direct proxy)
  • Recommends moderate TTLs with stale-while-revalidate and event-driven invalidation
  • Provides guardrails for cache invalidation via webhooks and manual purges
  • Use Case: A headless storefront that serves Intelligent Search and Catalog data with caching while keeping checkout data fresh

Quick Start

Configure your BFF and CDN caches to enforce a 2-15 minute TTL with stale-while-revalidate for cacheable endpoints, and disable caching for checkout and personal data.

Frequently Asked Questions about headless-caching-strategy

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

FAQPage Schema
How do I implement caching for a headless VTEX storefront?

Use BFF-level caching for catalog data and CDN caching for Intelligent Search, applying 2-15 minute TTLs with stale-while-revalidate. Ensure explicit non-caching for checkout, profile, OMS, and payments to maintain data freshness.

What VTEX APIs should not be cached on a headless storefront?

Checkout, profile, OMS, and payments APIs should not be cached on a headless storefront. Direct proxying without caching ensures sensitive user data and transactional states remain fresh and accurate during the customer journey.

What is the recommended TTL for VTEX catalog data in a BFF cache?

The recommended TTL for VTEX catalog data in a BFF cache is 2-15 minutes. This moderate timeframe balances fast delivery with data freshness when combined with stale-while-revalidate and event-driven invalidation mechanisms.

How do I invalidate CDN cache for VTEX Intelligent Search results?

Invalidate CDN cache for VTEX Intelligent Search using event-driven webhooks or manual purges. These guardrails ensure outdated search queries are systematically cleared when underlying catalog data changes.

Does VTEX headless caching support stale-while-revalidate?

Yes, VTEX headless caching supports stale-while-revalidate. It is recommended for cacheable endpoints with moderate 2-15 minute TTLs to serve stale content instantly while asynchronously fetching fresh data in the background.

When should I use BFF caching instead of CDN caching for headless VTEX?

Use BFF caching for catalog data and CDN edge caching for Intelligent Search results on headless VTEX. Both layers utilize 2-15 minute TTLs, but BFF caching intermediates data requests before they reach the CDN edge.