Nextjs caching issues, users seeing old content returned from prismic api

Impacted feature

The homepage of the website shows the 10 most recently added articles. Some of our users are not seeing the updated content after it is published on Prismic, but the content appears if they visit the website in incognito mode.

Our website is built with the Nextjs pages router and uses the deploy hook integration with Vercel to trigger a new build

What steps have you taken to resolve this issue already?

We looked at some suggestions in this thread, but most of them use the app router so I'm not sure how much they apply to our website still using the pages router

Tried the following steps but none of them worked

  • added cache: 'no-cache', to fetchOptions when calling prismic.createClient in prismisc.ts:
  const client = prismic.createClient(repositoryName, {
    fetchOptions: {
      cache: 'no-cache',
      ...(config.fetchOptions ?? {})
  • Updated Next version from 13.4.9 to 14.2.3

Hosting provider


I can provide .har files with examples of a request on the homepage showing stale content and one showing the updated content if that helps with debugging.

Is there anything you suggest that can help with this intermittent caching issue?

The prismic client would normally only be used/initialized during the build itself, so those fetchOptions would only affect the static site generation. With pages router this is normally done via getStaticProps which only runs on the server and never on the client.

This part makes me think the issue is not with prismic or even the next.js build process, but something on the Vercel side (cache control headers maybe) or their browser is aggressively caching things for some reason.

If it always loads correctly incognito then I would assume there is nothing wrong with your prismic client config / next build process and start looking towards browser cache.

You may want to read the caching documentation page

Do you know if they eventually see the updated posts using normal refresh?