notion-performance-tuning

Featured

Optimize Notion API performance with caching, batching, parallel requests, and incremental sync. Use when experiencing slow API responses, implementing caching strategies, reducing API call volume, or tuning request patterns for Notion integrations. Trigger with phrases like "notion performance", "optimize notion api", "notion latency", "notion caching", "notion slow", "notion batch requests", "notion incremental sync", "notion reduce api calls".

AI & Automation 2,249 stars 312 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Notion Performance Tuning ## Overview Optimize Notion API performance by minimizing API calls, caching responses with TTL-based invalidation, batching block appends, parallelizing requests within rate limits, selecting only needed properties, and implementing incremental sync patterns. Target latency benchmarks: Database Query p50=150ms, Page Create p50=200ms, Search p50=300ms. ## Prerequisites - `@notionhq/client` installed (`npm install @notionhq/client`) - `p-queue` for rate-limited parallelism (`npm install p-queue`) - `lru-cache` for TTL-based caching (`npm install lru-cache`) - Understanding of your access patterns (read-heavy vs write-heavy) - Optional: Redis or `ioredis` for distributed caching across instances ## Instructions ### Step 1: Minimize API Calls and Reduce Payload Avoid N+1 query patterns. Use `page_size: 100` (the maximum) to reduce pagination requests. Select only the properties you need in database queries to shrink response payloads. ```typescript import { Client } from '@notionhq/client'; const notion = new Client({ auth: process.env.NOTION_TOKEN }); // BAD: N+1 pattern — fetching content for every page individually async function fetchAllBad(dbId: string) { const pages = await notion.databases.query({ database_id: dbId }); for (const page of pages.results) { // Each iteration is a separate API call — O(n) requests const content = await notion.blocks.children.list({ block_id: page.id }); } } // GOOD: Use filter_properties to s...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Related Skills