{
  "slug": "sub-10ms-api-for-mobile-apps",
  "title": "Sub 10ms API Response Time for Mobile Apps",
  "metaDescription": "Sub 10ms api response time for mobile apps. Shield REST API with 300s GET edge cache; cache key uses query params on sub-10ms-api-for-mobile-apps.",
  "headline": "REST API GET traffic cached ahead of rate limits",
  "category": "caching",
  "categoryLabel": "Edge Caching & Rate Limits",
  "urgency": 8,
  "clientPlatform": "Mobile App (iOS & Android)",
  "upstreamServices": [
    "REST API"
  ],
  "searchIntentQuery": "sub 10ms api response time for mobile apps",
  "directAnswerSummary": "REST API rate limits hit fast from Mobile App (iOS & Android). Cache 300s on GET calls where the query string scopes the response.",
  "problem": {
    "title": "REST API rate limits from Mobile App (iOS & Android) traffic",
    "explanation": "Without edge caching, identical REST API reads during a session still round-trip to the origin.",
    "risks": [
      "HTTP 429 responses during launch traffic",
      "Surprise SaaS overages from duplicate reads",
      "Slower repeat views than necessary"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Add vault secrets for this pipeline",
      "description": "Add API_BEARER_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream."
    },
    {
      "stepNumber": 2,
      "title": "Set headers, mapping, and cache TTL",
      "description": "Use GET against https://jsonplaceholder.typicode.com/users/{{query.userId}}. Allowed origins on the client token should match set cache ttl to 300s so repeat gets with the same query string hit caches.default."
    },
    {
      "stepNumber": 3,
      "title": "Call from Mobile App (iOS & Android)",
      "description": "Call https://realcomposer.com/v1/workspace/sub-10ms-api-for-mobile-apps with a restricted rc_live_ client token. Mobile App (iOS & Android) never sends upstream secrets.",
      "codeSnippet": "let url = URL(string: \"https://realcomposer.com/v1/workspace/sub-10ms-api-for-mobile-apps\")!\nvar request = URLRequest(url: url)\nrequest.addValue(\"Bearer rc_live_token\", forHTTPHeaderField: \"Authorization\")"
    }
  ],
  "pipelineConfig": {
    "name": "Sub 10ms API Response Time for Mobile Apps",
    "method": "GET",
    "cacheTtlSeconds": 300,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "upstream",
        "upstreamUrlTemplate": "https://jsonplaceholder.typicode.com/users/{{query.userId}}",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.API_BEARER_TOKEN}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "userId",
          "sourcePath": "id",
          "type": "number",
          "sourceStep": "upstream"
        },
        {
          "targetPath": "name",
          "sourcePath": "name",
          "type": "string",
          "sourceStep": "upstream"
        },
        {
          "targetPath": "email",
          "sourcePath": "email",
          "type": "string",
          "sourceStep": "upstream"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_sub-10ms",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "sub-10ms-api-for-mobile-apps"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "userId": "sample",
    "name": "sample",
    "email": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/sub-10ms-api-for-mobile-apps\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Which REST API credential belongs in the vault for this pipeline?",
      "answer": "Log request IDs for sub-10ms-api-for-mobile-apps, not raw REST API payloads, because upstream bodies may include PII."
    },
    {
      "question": "What cache key does RealComposer use?",
      "answer": "sub-10ms-api-for-mobile-apps vault headers attach server-side, but Anthropic or OpenAI model and messages must come from the client body."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Rotate vault secrets for sub-10ms-api-for-mobile-apps anytime; clients keep the same rc_live_ token."
    }
  ],
  "relatedRecipeSlugs": [
    "reverse-proxy-api-key-protection",
    "algolia-write-api-secure-proxy",
    "plaid-api-proxy-flutter"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/sub-10ms-api-for-mobile-apps",
    "markdown": "https://realcomposer.com/recipes/sub-10ms-api-for-mobile-apps.md",
    "json": "https://realcomposer.com/recipes/sub-10ms-api-for-mobile-apps.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=sub-10ms-api-for-mobile-apps&via=agent"
  }
}