Salesforce composite api cache mobile dashboard
Sales rep mobile home with fewer API calls
Composite read responses cached per user id at edge. For "salesforce composite api cache mobile dashboard", store SALESFORCE_ACCESS_TOKEN in Secret Vault, call https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} from a Worker, and let React Native hit only https://realcomposer.com/v1/workspace/cache-salesforce-composite-mobile-dashboard with an rc_live_ client token. Enable 120s GET cache only when query params identify the resource.
Uncached Salesforce spikes cost and latency
Every React Native visitor can trigger a fresh Salesforce 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 SALESFORCE_ACCESS_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.
Configure upstream steps and output mapping
Configure headersTemplate to inject vault secrets, target https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}}, and Add output mapping fields that mirror the JSON contract your screen already expects.
Call from React Native
Allowed origins on the token should list every React Native host that calls this URL.
const res = await fetch('https://realcomposer.com/v1/workspace/cache-salesforce-composite-mobile-dashboard', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
{
"requestId": "req_cache-sa",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "cache-salesforce-composite-mobile-dashboard"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"contactId": "sample",
"email": "sample",
"name": "sample"
}
Recipe Specs
- HTTP method
- GET
- Upstream calls
- 1
- Edge cache TTL
- 120s
- Client auth
- Restricted client token
- Mapped output fields
- 3
- Payload
- 262 B to 55 B (-79%)
curl -X GET "https://realcomposer.com/v1/workspace/cache-salesforce-composite-mobile-dashboard" \ -H "Authorization: Bearer rc_live_client_token"
Developer Questions & Troubleshooting
Is it safe to log Salesforce responses in React Native?
Use scoped tokens where the vendor allows them on cache-salesforce-composite-mobile-dashboard. Admin keys stay {{secrets.*}} references only.
When does edge caching apply to this recipe?
cache-salesforce-composite-mobile-dashboard: only GET requests cache (120s on caches.default). Key is workspace slug plus sorted query params, not Authorization.
What happens if an upstream step times out?
Allowed origins on the cache-salesforce-composite-mobile-dashboard client token restrict which domains may call the edge URL.
Sources & Definitions Used in This Answer
Deploy this React Native + Salesforce Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.