{
  "slug": "cache-cloudinary-transformations-edge",
  "title": "Cache cloudinary transformation api at edge",
  "metaDescription": "Cache cloudinary transformation api at edge. Shield Cloudinary with 300s GET edge cache; cache key uses query params on.",
  "headline": "Image-heavy SPAs with fewer origin hits",
  "category": "caching",
  "categoryLabel": "Edge Caching & Rate Limits",
  "urgency": 8,
  "clientPlatform": "Vue / SPA",
  "upstreamServices": [
    "Cloudinary"
  ],
  "searchIntentQuery": "cache cloudinary transformation api at edge",
  "directAnswerSummary": "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.",
  "problem": {
    "title": "Uncached Cloudinary spikes cost and latency",
    "explanation": "Every Vue / SPA visitor can trigger a fresh Cloudinary call. Bursts exhaust per-minute quotas even when data changes slowly.",
    "risks": [
      "Thundering herds after cache expiry on the origin",
      "Analytics skewed by client-side retry storms",
      "Support tickets blaming \"API downtime\" during spikes"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Add vault secrets for this pipeline",
      "description": "Create CLOUDINARY_BASIC_AUTH vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "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."
    },
    {
      "stepNumber": 3,
      "title": "Call from Vue / SPA",
      "description": "Call https://realcomposer.com/v1/workspace/cache-cloudinary-transformations-edge with a restricted rc_live_ client token. Vue / SPA never sends upstream secrets.",
      "codeSnippet": "const { data } = await useFetch('https://realcomposer.com/v1/workspace/cache-cloudinary-transformations-edge', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "Cache cloudinary transformation api at edge",
    "method": "GET",
    "cacheTtlSeconds": 300,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "cloudinary",
        "upstreamUrlTemplate": "https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Basic {{secrets.CLOUDINARY_BASIC_AUTH}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "publicId",
          "sourcePath": "resources.0.public_id",
          "type": "string",
          "sourceStep": "cloudinary"
        },
        {
          "targetPath": "format",
          "sourcePath": "resources.0.format",
          "type": "string",
          "sourceStep": "cloudinary"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "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"
      }
    }
  },
  "sampleSlimmedOutput": {
    "publicId": "sample",
    "format": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/cache-cloudinary-transformations-edge\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Which Cloudinary credential belongs in the vault for this pipeline?",
      "answer": "Store CLOUDINARY_BASIC_AUTH for cache-cloudinary-transformations-edge. Vue / SPA never sees decrypted values."
    },
    {
      "question": "Does POST traffic get cached?",
      "answer": "cache-cloudinary-transformations-edge vault headers attach server-side, but Anthropic or OpenAI model and messages must come from the client body."
    },
    {
      "question": "Can I restrict which domains call this pipeline?",
      "answer": "Upstream steps in cache-cloudinary-transformations-edge honor timeoutMs and optional fallback JSON without leaking secrets."
    }
  ],
  "relatedRecipeSlugs": [
    "edge-caching-reverse-proxy",
    "reduce-third-party-api-costs-caching"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/cache-cloudinary-transformations-edge",
    "markdown": "https://realcomposer.com/recipes/cache-cloudinary-transformations-edge.md",
    "json": "https://realcomposer.com/recipes/cache-cloudinary-transformations-edge.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=cache-cloudinary-transformations-edge&via=agent"
  }
}