deco-api-call-dedup

Detect and fix duplicate VTEX API calls in Deco TanStack storefronts.

5|2|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/decocms/deco-start --skill deco-api-call-dedup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deco-api-call-dedup
Source: https://github.com/decocms/deco-start/tree/main/.cursor/skills/deco-api-call-dedup
Command: npx skills add https://github.com/decocms/deco-start --skill deco-api-call-dedup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Detect and fix duplicate/N+1 API calls in Deco TanStack storefronts. Covers vtexCachedFetch SWR cache for all VTEX GET calls, slugCache via fetchWithCache, cross-selling SWR cache, usePriceSimulationBatch for batching simulation POSTs, PLP path filtering to avoid spurious pagetype calls, pageType dedup, site loader registration, cachedLoader inflight dedup in dev mode, and HAR analysis techniques. Use when server logs show repeated VTEX API calls, PDP/PLP loads trigger excessive calls, simulation calls happen one-by-one, or "Unhandled resolver" warnings appear.

Core Features & Use Cases

  • In-depth VTEX API call deduplication across common storefront workflows including PDP, PLP, and related sections.
  • Batched operations (price simulations, cross-sell lookups) and in-flight dedup to minimize latency and server load.
  • Observability & HAR-based diagnosis to locate N+1 patterns and guide fixes.

Quick Start

Run the deco-api-call-dedup patterns to reduce VTEX API calls by enabling vtexCachedFetch, slugCache, and batch simulations across PDP/PLP.

Frequently Asked Questions about deco-api-call-dedup

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

FAQPage Schema
How do I fix duplicate VTEX API calls in a Deco storefront?

Fix duplicate VTEX API calls by applying vtexCachedFetch SWR caching, slugCache via fetchWithCache, and batch price simulations across PDP and PLP loaders to deduplicate redundant requests.

Why does my PDP or PLP load trigger excessive VTEX API requests?

PDP or PLP loads trigger excessive requests due to unbatched price simulations, missing PLP path filtering, or absent pageType dedup. Implementing fetchWithCache and batch simulations resolves this N+1 pattern.

How do I batch VTEX price simulation POST requests?

Batch VTEX price simulation POST requests using usePriceSimulationBatch to group individual simulation calls, reducing server load and minimizing latency on Deco TanStack storefronts.

Can I use in-flight dedup to cache VTEX fetch calls in dev mode?

Yes, you can use cachedLoader inflight dedup in dev mode to intercept and deduplicate simultaneous in-flight VTEX requests, preventing redundant API calls during local development.

What is the best way to diagnose N+1 VTEX API calls?

The best way to diagnose N+1 VTEX API calls is using HAR analysis techniques to inspect network requests, locate repeated calls, and guide deduplication fixes like SWR cache and batch simulations.

Does Deco fetch-cache support cross-selling endpoint deduplication?

Yes, Deco fetch-cache supports cross-selling endpoint deduplication by applying cross-selling SWR cache patterns to group related product lookups and prevent redundant VTEX API calls.