| name | hootsuite-performance-tuning |
| description | Optimize Hootsuite API performance with caching, batching, and connection pooling.
Use when experiencing slow API responses, implementing caching strategies,
or optimizing request throughput for Hootsuite integrations.
Trigger with phrases like "hootsuite performance", "optimize hootsuite",
"hootsuite latency", "hootsuite caching", "hootsuite slow", "hootsuite batch".
|
| allowed-tools | Read, Write, Edit |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","hootsuite","social-media"] |
| compatibility | Designed for Claude Code |
Hootsuite Performance Tuning
Instructions
Step 1: Cache Social Profiles
import { LRUCache } from 'lru-cache';
const profileCache = new LRUCache<string, any>({ max: 100, ttl: 3600000 });
async function getCachedProfiles(): Promise<any[]> {
const cached = profileCache.get('profiles');
if (cached) return cached;
const response = await fetch('https://platform.hootsuite.com/v1/socialProfiles', {
headers: { 'Authorization': `Bearer ${await getStoredToken()}` },
});
const { data } = await response.json();
profileCache.set('profiles', data);
return data;
}
Step 2: Batch Message Scheduling
import PQueue from 'p-queue';
const scheduleQueue = new PQueue({ concurrency: 2, : , : });
() {
results = .(
posts.(
scheduleQueue.(
(, {
: ,
: { : , : },
: .({ : post., : [post.], : post..() }),
}).( r.())
)
)
);
succeeded = results.( r. === ).;
.();
}