Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Optimize Adobe API performance with token caching, async job batching, connection pooling, and response caching for Firefly, PDF Services, and Photoshop API workflows. Trigger with phrases like "adobe performance", "optimize adobe", "adobe latency", "adobe caching", "adobe slow", "adobe batch".
.claude/skills/jeremylongshore-adobe-performance-tuning/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 47% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 80% | 0% |
| case-19 | ✗→✓ | ▲ Improved | -7% | 0% |
| case-10 | ✓→✓ | = Same ✓ | 56% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 67% | 0% |
Optimize Adobe API performance across Firefly Services, PDF Services, and Photoshop APIs. Key bottlenecks include IMS token generation, async job polling overhead, and cold-start latency on serverless platforms.
| Operation | P50 | P95 | P99 | |-----------|-----|-----|-----| | IMS Token Generation | 200ms | 500ms | 1s | | Firefly Text-to-Image (sync) | 5s | 12s | 20s | | Firefly Text-to-Image (async poll) | 8s | 15s | 25s | | PDF Extract (10-page doc) | 3s | 8s | 15s | | PDF Create from HTML | 2s | 5s | 10s | | Photoshop Remove Background | 4s | 10s | 18s | | Lightroom Auto Tone | 3s | 8s | 15s |
The IMS token endpoint returns tokens valid for 24 hours. Never re-generate per request:
typescript// WRONG: generates new token every call (adds 200-500ms each time) async function makeRequest() { const token = await getAccessToken(); // hits IMS every time } // RIGHT: cache token and only refresh when expiring let tokenCache: { token: string; expiresAt: number } | null = null; async function getCachedToken(): Promise<string> { if (tokenCache && tokenCache.expiresAt > Date.now() + 300_000) { return tokenCache.token; // Cache hit — 0ms } const res = await fetch('https://ims-na1.adobelogin.com/ims/token/v3', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ client_id: process.env.ADOBE_CLIENT_ID!, client_secret: process.env.ADOBE_CLIENT_SECRET!, grant_type: 'client_credentials', scope: process.env.ADOBE_SCOPES!, }), }); const data = await res.json(); tokenCache = { token: data.access_token, expiresAt: Date.now() + data.expires_in * 1000 }; return tokenCache.token; }
Firefly and Photoshop APIs are async — submit all jobs first, then poll all:
typescript// SLOW: sequential (total = sum of all job times) for (const prompt of prompts) { const result = await generateImageSync(prompt); // 5-20s each } // FAST: parallel submit + parallel poll (total = max job time) async function batchFireflyGenerate(prompts: string[]) { const token = await getCachedToken(); // 1. Submit all jobs simultaneously const jobSubmissions = await Promise.all( prompts.map(prompt => fetch('https://firefly-api.adobe.io/v3/images/generate-async', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'x-api-key': process.env.ADOBE_CLIENT_ID!, 'Content-Type': 'application/json', }, body: JSON.stringify({ prompt, n: 1, size: { width: 1024, height: 1024 } }), }).then(r => r.json()) ) ); // 2. Poll all jobs in parallel const results = await Promise.all( jobSubmissions.map(job => pollUntilDone(job.statusUrl, token)) ); return results; }
typescriptimport { LRUCache } from 'lru-cache'; // Cache PDF extraction results (same PDF = same output) const extractionCache = new LRUCache<string, any>({ max: 100, ttl: 3600_000, // 1 hour }); async function cachedPdfExtract(pdfHash: string, pdfPath: string) { const cached = extractionCache.get(pdfHash); if (cached) { console.log('PDF extraction cache hit'); return cached; } const result = await extractPdfContent(pdfPath); extractionCache.set(pdfHash, result); return result; }
typescriptimport { Agent } from 'https'; // Reuse TCP connections to Adobe endpoints const adobeAgent = new Agent({ keepAlive: true, maxSockets: 10, maxFreeSockets: 5, timeout: 60_000, }); // Use with node-fetch or undici const response = await fetch(url, { // @ts-ignore — agent option supported by node-fetch agent: adobeAgent, headers: { ... }, });
typescript// Adaptive polling: start fast, slow down over time async function adaptivePoll(statusUrl: string, token: string) { const intervals = [1000, 2000, 3000, 5000, 5000, 10000]; // ms let attempt = 0; while (true) { const res = await fetch(statusUrl, { headers: { 'Authorization': `Bearer ${token}`, 'x-api-key': process.env.ADOBE_CLIENT_ID!, }, }); const status = await res.json(); if (status.status === 'succeeded') return status; if (status.status === 'failed') throw new Error(status.error?.message); const delay = intervals[Math.min(attempt, intervals.length - 1)]; await new Promise(r => setTimeout(r, delay)); attempt++; } }
| Issue | Cause | Solution | |-------|-------|----------| | Stale cached token | Token revoked mid-lifecycle | Catch 401, clear cache, retry once | | Parallel rate limiting | Too many concurrent jobs | Add p-queue concurrency limit | | Cache memory pressure | Too many cached results | Set LRU max size | | Connection pool exhaustion | Too many parallel requests | Limit maxSockets to 10-20 |
Start with the smallest applicable command or code example already provided in this guide, using a non-production Adobe environment and credentials. Confirm the documented response or validation result before applying the pattern to production.
For cost optimization, see adobe-cost-tuning.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-10 | pass→pass | 15,516 | 12,238 | -21% | 1 | 1 | 0% | 2,703 | 4,210 | +56% | 0 | 0 | — |
case-01 | fail→pass | 21,926 | 48,200 | +120% | 1 | 1 | 0% | 3,940 | 5,785 | +47% | 0 | 0 | — |
case-02 | fail→fail | 16,381 | 16,842 | +3% | 1 | 1 | 0% | 3,284 | 5,265 | +60% | 0 | 0 | — |
case-03 | pass→pass | 17,723 | 16,227 | -8% | 1 | 1 | 0% | 3,228 | 5,381 | +67% | 0 | 0 | — |
case-04 | pass→pass | 15,920 | 15,406 | -3% | 1 | 1 | 0% | 2,776 | 4,434 | +60% | 0 | 0 | — |
case-05 | pass→pass | 15,617 | 13,698 | -12% | 1 | 1 | 0% | 2,788 | 4,244 | +52% | 0 | 0 | — |
case-06 | pass→pass | 18,054 | 13,087 | -28% | 1 | 1 | 0% | 3,308 | 4,279 | +29% | 0 | 0 | — |
case-07 | pass→pass | 18,762 | 15,209 | -19% | 1 | 1 | 0% | 3,785 | 4,691 | +24% | 0 | 0 | — |
case-08 | fail→fail | 17,650 | 16,509 | -6% | 1 | 1 | 0% | 3,058 | 4,559 | +49% | 0 | 0 | — |
case-09 | fail→pass | 13,813 | 44,722 | +224% | 1 | 1 | 0% | 2,203 | 3,960 | +80% | 0 | 0 | — |
case-11 | pass→pass | 9,279 | 6,017 | -35% | 1 | 1 | 0% | 1,775 | 3,092 | +74% | 0 | 0 | — |
case-12 | pass→pass | 11,543 | 12,589 | +9% | 1 | 1 | 0% | 1,903 | 4,015 | +111% | 0 | 0 | — |
case-13 | fail→fail | 14,571 | 11,329 | -22% | 1 | 1 | 0% | 2,480 | 3,851 | +55% | 0 | 0 | — |
case-14 | pass→pass | 19,109 | 10,789 | -44% | 1 | 1 | 0% | 3,355 | 3,929 | +17% | 0 | 0 | — |
case-19 | fail→pass | 14,717 | 2,542 | -83% | 1 | 1 | 0% | 2,494 | 2,327 | -7% | 0 | 0 | — |
case-15 | pass→pass | 10,531 | 5,228 | -50% | 1 | 1 | 0% | 1,909 | 2,846 | +49% | 0 | 0 | — |
case-16 | pass→pass | 9,959 | 6,583 | -34% | 1 | 1 | 0% | 2,016 | 3,353 | +66% | 0 | 0 | — |
case-17 | pass→pass | 14,423 | 4,265 | -70% | 1 | 1 | 0% | 2,547 | 2,490 | -2% | 0 | 0 | — |
case-18 | fail→fail | 14,906 | 10,473 | -30% | 1 | 1 | 0% | 2,565 | 3,655 | +42% | 0 | 0 | — |
case-20 | fail→fail | 17,083 | 20,476 | +20% | 1 | 1 | 0% | 2,660 | 5,577 | +110% | 0 | 0 | — |
case-21 | fail→fail | 14,317 | 11,982 | -16% | 1 | 1 | 0% | 2,238 | 3,857 | +72% | 0 | 0 | — |
case-22 | fail→fail | 16,803 | 12,653 | -25% | 1 | 1 | 0% | 2,636 | 4,266 | +62% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +14 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 8/13/2026 | +17% |
Other measured skills in the registry, with their headline benchmark lift.