Cache cloudinary transformation api at edge
Image-heavy SPAs with fewer origin hits
Cache transformation metadata responses per public_id. For "cache cloudinary transformation api at edge", store CLOUDINARY_BASIC_AUTH in Secret Vault, call https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image from a Worker, and let Vue / SPA hit only https://realcomposer.com/v1/workspace/cache-cloudinary-transformations-edge with an rc_live_ client token. Enable 300s GET cache only when query params identify the resource.
Uncached Cloudinary spikes cost and latency
Every Vue / SPA visitor can trigger a fresh Cloudinary 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
Add vault secrets for this pipeline
Create CLOUDINARY_BASIC_AUTH vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders.
Target the real upstream URL
Point step cloudinary at https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image 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 Vue / SPA
Call https://realcomposer.com/v1/workspace/cache-cloudinary-transformations-edge with a restricted rc_live_ client token. Vue / SPA never sends upstream secrets.
const { data } = await useFetch('https://realcomposer.com/v1/workspace/cache-cloudinary-transformations-edge', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
{
"requestId": "req_cache-cl",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "cache-cloudinary-transformations-edge"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"publicId": "sample",
"format": "sample"
}
Recipe Specs
- HTTP method
- GET
- Upstream calls
- 1
- Edge cache TTL
- 300s
- Client auth
- Restricted client token
- Mapped output fields
- 2
- Payload
- 256 B to 39 B (-85%)
curl -X GET "https://realcomposer.com/v1/workspace/cache-cloudinary-transformations-edge" \ -H "Authorization: Bearer rc_live_client_token"
Developer Questions & Troubleshooting
Which Cloudinary credential belongs in the vault for this pipeline?
Store CLOUDINARY_BASIC_AUTH for cache-cloudinary-transformations-edge. Vue / SPA never sees decrypted values.
Does POST traffic get cached?
cache-cloudinary-transformations-edge 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?
Upstream steps in cache-cloudinary-transformations-edge honor timeoutMs and optional fallback JSON without leaking secrets.
Sources & Definitions Used in This Answer
Deploy this Vue / SPA + Cloudinary Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.