Optimize Supabase API performance with caching, batching, and connection pooling. Use when experiencing slow API responses, implementing caching strategies, or optimizing request throughput for Supabase integrations. Trigger with phrases like "supabase performance", "optimize supabase", "supabase latency", "supabase caching", "supabase slow", "supabase batch".
From supabase-packnpx claudepluginhub nickloveinvesting/nick-love-plugins --plugin supabase-packThis skill is limited to using the following tools:
references/caching-strategy.mdreferences/errors.mdreferences/examples.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Details PluginEval's skill quality evaluation: 3 layers (static, LLM judge), 10 dimensions, rubrics, formulas, anti-patterns, badges. Use to interpret scores, improve triggering, calibrate thresholds.
Performance tuning a Supabase integration should follow a measurement-first discipline. Applying optimizations without a baseline makes it impossible to quantify impact, and premature optimization often targets the wrong bottleneck. Start with profiling, then apply targeted improvements in order of expected impact.
Measure current latency for critical Supabase operations using application-level instrumentation or the Supabase query editor's explain analyze output. Record P50, P95, and P99 latencies for each operation under representative load. Identify the three to five slowest operations as your primary targets.
Add response caching for frequently accessed data that changes infrequently. Use TTL-based invalidation for data that has a predictable freshness requirement and event-driven invalidation for data that must be immediately consistent after writes. An LRU cache in memory is appropriate for single-instance applications; Redis is needed for multi-instance deployments.
Use DataLoader or a similar batching library to coalesce multiple individual record lookups into a single Supabase query with an IN clause. This is especially effective in GraphQL resolvers where N+1 query problems are common. Verify the batch size does not exceed Supabase's row limit per request.
Configure connection pooling with keep-alive settings appropriate for your deployment environment. Serverless functions require aggressive connection reuse via PgBouncer in transaction mode; long-running servers can use session-mode pooling with a larger pool size.
See ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error handling.
See ${CLAUDE_SKILL_DIR}/references/examples.md for detailed examples.
Optimize Supabase API performance with caching, batching, and connection pooling.