Vercel hosting - ISR reads and writes in NextJS

Hello guys

We have in our app several pages (~couple hundred) which are using ISR.
These pages are created on the build.

They are created like this

export const getStaticPaths: GetStaticPaths<{ id: string }> = async () => {
  return {
    paths: [
       //xxx
    ],
    fallback: false,
  };
};

export const getStaticProps = async () => {
  // xxx

  return {
    props: {
      // xxx
    },
    revalidate: false,
  };
};

We create all the pages during the build. We never need to revalidate these pages. These pages can be changed only during the full re-deploy of the application. I would assume these pages would behave the same way as static pages.

But we are seeing a LOT of ISR Read units consumptions on our dashboards. The problem is that the cost is 0.4$ per 1M read units. Also we see huge traffic on Fast Origin (not sure if that’s counted to ISR).

We were wondering if there are some kinds of optimization we could do, we are trying to cache everything on CDN to avoid any additional ISR Reads but they are happening regardless (most likely different regions).

Thanks

Hi, @petrvecera! Welcome to the Vercel Community :smile:

Based on your ISR implementation and high read unit costs, I recommend a few optimizations.

First, consider using Route Handlers with proper Cache-Control headers for dynamic data. You can set longer revalidation times (e.g., 1 hour or more) if your data doesn’t need frequent updates.

Since you’re seeing high Fast Origin traffic, implement proper CDN caching by setting appropriate cache headers and using stale-while-revalidate directives. This will help serve cached content while updating in the background.

Additionally, consider moving truly static content to static generation without revalidation, and use Edge Runtime where possible to reduce compute costs. These changes should help optimize your ISR usage and reduce costs while maintaining performance.

Some recommend docs:

  1. Route Handlers: https://vercel.com/docs/concepts/functions/serverless-functions/edge-functions#route-handlers
  2. Caching and Revalidating: https://vercel.com/docs/concepts/next.js/incremental-static-regeneration
  3. Edge Runtime: https://vercel.com/docs/concepts/functions/edge-functions
  4. CDN Caching Strategies: https://vercel.com/docs/concepts/edge-network/caching
  5. Vercel Analytics: https://vercel.com/docs/analytics
  6. Optimizing ISR: https://vercel.com/docs/concepts/next.js/incremental-static-regeneration/strategies

I hope that helps!