How to Cache Github API Rate Limit 60 Requests Per Hour
Edge TTL shield for Frontend / Web GitHub calls
To how to cache github api rate limit 60 requests per hour, set cacheTtlSeconds on a GET pipeline targeting https://api.github.com/user/repos?per_page=5. Identical query strings reuse Cloudflare caches.default before upstream sees traffic.
Uncached GitHub spikes cost and latency
Every Frontend / Web visitor can trigger a fresh GitHub call. Bursts exhaust per-minute quotas even when data changes slowly.
- Thundering herds after cache expiry on the origin
- Analytics skewed by client-side retry storms
- Support tickets blaming "API downtime" during spikes
How RealComposer Solves This at the Edge
Store upstream credentials in Secret Vault
Add GITHUB_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.
Set headers, mapping, and cache TTL
Point step github at https://api.github.com/user/repos?per_page=5 with GET. Add output mapping fields that mirror the JSON contract your screen already expects. Set cache TTL to 300s so repeat GETs with the same query string hit caches.default.
Call from Frontend / Web
Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.
const res = await fetch('https://realcomposer.com/v1/workspace/cache-github-api-avoid-rate-limit', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
{
"requestId": "req_cache-gi",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "cache-github-api-avoid-rate-limit"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"repoId": "sample",
"fullName": "sample",
"isPrivate": "sample"
}
Recipe Specs
- HTTP method
- GET
- Upstream calls
- 1
- Edge cache TTL
- 300s
- Client auth
- Restricted client token
- Mapped output fields
- 3
- Payload
- 252 B to 60 B (-76%)
curl -X GET "https://realcomposer.com/v1/workspace/cache-github-api-avoid-rate-limit" \ -H "Authorization: Bearer rc_live_client_token"
Developer Questions & Troubleshooting
What should Frontend / Web store instead of GitHub secrets?
Log request IDs for cache-github-api-avoid-rate-limit, not raw GitHub payloads, because upstream bodies may include PII.
How do I forward JSON bodies to POST upstreams?
cache-github-api-avoid-rate-limit vault headers attach server-side, but Anthropic or OpenAI model and messages must come from the client body.
Can I restrict which domains call this pipeline?
Allowed origins on the cache-github-api-avoid-rate-limit client token restrict which domains may call the edge URL.
Sources & Definitions Used in This Answer
Deploy this Frontend / Web + GitHub Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.