
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI understand you're experiencing high API usage from Sanity Studio during editing and finding that your CDN isn't being utilized as expected. Let me break down what's happening with both issues.
When you edit documents in Sanity Studio, you're seeing thousands of API requests fire on each keystroke. This is expected behavior and is how Studio's autosave system works:
drafts.) as you typeapi.sanity.io), never the CDNThis behavior cannot be disabled or reduced - it's a core part of how Studio functions to provide a robust authoring experience. The API is designed to handle this load, and these requests count against your API quota (not CDN quota). Mutations cannot be cached by design since they're write operations.
The second issue is more straightforward than it might seem. Based on the Sanity CDN documentation, when you set useCdn: true in your client configuration, it tells the JavaScript client to fetch from apicdn.sanity.io instead of api.sanity.io.
Critical detail: In your configuration, you have a typo:
useCDN: process.env.NEXT_PUBLIC_SANITY_DATASET_NAME === "production"Notice it's useCDN (uppercase "CDN") but the correct property name is useCdn (lowercase "dn"). JavaScript is case-sensitive, so this typo means the client isn't recognizing your CDN setting at all and is defaulting to useCdn: false.
Fix the typo in all your client configurations:
// helpers/sanity.js
const options = {
projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID,
dataset: process.env.NEXT_PUBLIC_SANITY_DATASET_NAME,
apiVersion: '2022-01-18',
useCdn: process.env.NEXT_PUBLIC_SANITY_DATASET_NAME === "production" // lowercase 'dn'
};Also fix it in helpers/generateRedirects.js:
const options = {
projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID,
dataset: process.env.NEXT_PUBLIC_SANITY_DATASET_NAME,
apiVersion: "2022-01-18",
useCdn: process.env.NEXT_PUBLIC_SANITY_DATASET_NAME === "production" // lowercase 'dn'
};Even with useCdn: true correctly configured, certain operations will always bypass the CDN:
According to the Live CDN documentation, the API CDN uses intelligent caching with approximately 10-minute cache times, providing a balance between freshness and performance.
After correcting the typo:
Images: Assets always use the asset CDN (cdn.sanity.io) regardless of the useCdn setting - this is separate from the API CDN and explains why you're seeing cdn.sanity.io URLs for images even when your API queries weren't using the CDN.
Warning message: The console warning about useCdn not being specified should disappear once you fix the typo, as the client will properly recognize the setting.
The Studio's mutation-heavy behavior during editing is by design and ensures a robust authoring experience. The key to managing your API costs is ensuring your public-facing content delivery (your Next.js frontend) uses the CDN for read operations, which should now work once you fix the typo.
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