
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGood news - you've correctly set useCdn: false, which disables Sanity's CDN. However, the caching issue you're experiencing is almost certainly happening on the Next.js side, not Sanity's side.
Next.js has its own aggressive caching system that caches fetch requests by default. Even with useCdn: false, Next.js will still cache the responses from Sanity's API. Here's how to fix it:
cache: 'no-store'When fetching data, add the cache: 'no-store' option:
const data = await client.fetch(query, params, {
cache: 'no-store' // This disables Next.js caching
})Or if you're using the @sanity/client directly:
const data = await client.fetch(query, params, {
next: { revalidate: 0 } // Revalidate on every request
})For a production-ready solution, use Next.js's tag-based revalidation. This lets you keep caching benefits while invalidating specific content when it changes:
// In your fetch
const data = await client.fetch(query, params, {
next: { tags: ['post', 'author'] }
})
// Create an API route at /app/api/revalidate/route.ts
import { revalidateTag } from 'next/cache'
import { type NextRequest, NextResponse } from 'next/server'
export async function POST(req: NextRequest) {
const { tags } = await req.json()
tags.forEach((tag: string) => revalidateTag(tag))
return NextResponse.json({ revalidated: true })
}Then set up a webhook in Sanity to call this endpoint when content changes.
If you're on a recent version of next-sanity, consider using the Live Content API which automatically handles caching and invalidation for you - no manual cache management needed.
In development mode, try adding this to your next.config.js to see cache behavior more clearly:
module.exports = {
logging: {
fetches: {
fullUrl: true,
},
},
}The useCdn: false setting you've configured is correct for avoiding Sanity's CDN, but Next.js's own caching is the real culprit here. Start with cache: 'no-store' for immediate relief, then implement proper revalidation for production!
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