Skip to content

โฒ๏ธ Time-based revalidation

What is Time-based revalidation?

By default, SanityPress will update your website's content every 60 minutes, displaying all published Sanity content, using Next.js' revalidation features.

How do I change the behavior?

To change this frequency, or disable it altogether, update the revalidate value in the Sanity fetch method:

๐Ÿ“ src/lib/sanity/fetch.ts
export function fetchSanity<T = any>(...) {
  return client.fetch<T>(
    query,
    params,
    preview
      ? {
        // development
      }
      : {
        // production
        next: {
          revalidate: 3600,  // revalidate every hour (default)
          ...next,
        },
      }
  )
}

Set revalidate: false to disable time-based revalidation. With this setting, only new deployments will push published Sanity content to the live site.