
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis is actually a common issue related to how Sanity's CDN caching works! The behavior you're seeing is by design, and here's what's happening:
When you use @sanity/client with useCdn: true (which is often the default), your requests go through apicdn.sanity.io. The Live CDN uses a stale-while-revalidate caching strategy with a 600-second (10-minute) cache window.
Here's why you need to fetch twice:
This is the expected behavior of stale-while-revalidate caching - it prioritizes performance and availability by serving cached content immediately while updating in the background.
Option 1: Disable CDN for fresh data (Recommended for your use case)
Set useCdn: false in your client configuration:
import {createClient} from '@sanity/client'
const client = createClient({
projectId: 'your-project-id',
dataset: 'your-dataset',
useCdn: false, // Bypass CDN for always-fresh data
apiVersion: '2024-01-01'
})This sends requests directly to api.sanity.io instead of the CDN, giving you fresh data on every request.
Option 2: Use perspective parameter
You can also use the perspective parameter set to 'previewDrafts' or 'published' depending on your needs, but this works best when combined with useCdn: false for immediate updates.
useCdn: true: Best for production apps where slightly stale data (up to 10 minutes) is acceptable and you want better performance/lower latencyuseCdn: false: Best for admin interfaces, preview modes, or when you need guaranteed fresh data on every requestSince you're building a React Native app where users expect to see their edits immediately, setting useCdn: false is probably your best bet!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store