Agent skill · data analytics · jeremylongshore
klaviyo-performance-tuning
Optimize Klaviyo API performance with caching, batching, and pagination tuning. Use when experiencing slow API responses, implementing caching strategies, or optimizing request throughput for Klaviyo integrations. Trigger with phrases like "klaviyo performance", "optimize klaviyo", "klaviyo latency", "klaviyo caching", "klaviyo slow", "klaviyo batch".
Why this skill is useful
Adds executable scripts for optimizing Klaviyo API performance through caching, batching, and pagination techniques that aren't commonly known.
What it needs
Requires dataloader, klaviyo-api, lru-cache, p-queue installed locally. Requires klaviyo account access. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Klaviyo Performance Tuning Overview Optimize Klaviyo API performance with response caching, request batching, cursor-based pagination, sparse fieldsets, and connection pooling. This skill diagnoses where an integration is slow, then applies the right technique — payload reduction, memory caching, bounded pagination, request coalescing, or rate-limit-aware concurrency. Read this file for the workflow and the decision guide. Full, copy-pasteable code for every step lives in references/implementation.md; combined real-world scenarios live in references/examples.md. Prerequisites klaviyo-api SDK installed Understanding of Klaviyo's rate limits (75 req/s burst, 700 req/min) Redis or in-memory cache (optional) For batching/concurrency helpers: dataloader, p-queue, lru-cache Klaviyo API Performance Characteristics Operation Typical Latency Max Page Size ----------- ---------------- --------------- Get Profile by ID 50-150ms N/A Get Profiles (list) 100-300ms 20 (default), 100 (some endpoints) Create Profile 100-200ms N/A Create Event 50-100ms N/A Get Segment Profiles 200-500ms 20 Campaign Operations 200-500ms 20 Instructions Apply the techniques in order — each is independent, so start with the one that matches your bottleneck. Every step below has a full implementation in references/implementation.md. Step 1: Sparse Fieldsets (Reduce Payload Size) Klaviyo supports JSON:API sparse fieldsets — request only the fields you need instead of the 20+ default attributes. This is the cheapest win and applies to every read. Step 2: Response Caching Wrap read calls in an LRUCache keyed by query, with per-resource TTLs (profiles 5 min, segments 15 min — they change less often). See the caching implementation in references/implementation.md. Step 3: Efficient Pagination Use a fetchAllPages helper that follows the links.next cursor with a maxPages ceiling so large exports terminate predictably. See the pagination implementation in references/implementation.md. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/klaviyo-performance-tuning