skip to Main Content

I’m currently running the staging environment for a large project with 50+ dynamic pages. They implement time-based revalidation every 5 minutes on Vercel’s free tier.

Plus I have to import data for many more pages with dynamic params (like /posts/[slug]), where I cache them and have implemented revalidation of 5 mins as well.

Does the build time for those pages count towards the 6000 build minutes on Vercel hobby tier?

How would I go about calculating total revalidation time for them? Is it something I should worry about?

Should I delete the automatic deployments for new branches after I’m done with them, if they gobble up my build minutes as well?

I’m using the latest NextJS 14.0.3

2

Answers


  1. Chosen as BEST ANSWER

    So after digging around the documentation and experimenting with my Usage stats for a while this is what I found out:

    Does the build time for those pages count towards the 6000 build minutes on Vercel hobby tier?

    No, only data revalidation occurs and pages are not actually "rebuilt" in the traditional sense. Build minutes are only counted for deployments.

    How would I go about calculating total revalidation time for them? Is it something I should worry about?

    Not something to worry about at this scale since increasing revalidations hardly dented the free tier revalidation limit.

    Should I delete the automatic deployments for new branches after I'm done with them, if they gobble up my build minutes as well?

    N/A because ISR or time-based revalidation doesn't take away build time.


  2. If you are using an external api inside you /[slug] page without any revalidation then that mean next.js will bydefault will cache the api and each time you will get same response from that particular api or in other word the build will remain same and the page will be fully cached.

    If you want to have the latest data each time you refresh the page then you have add this on top of the slug page.

    export const dynamic='force-dynamic'
    

    If you wish to cache the page for 5 min then you can use revalidate.

    export const revalidate=300
    

    Note that ‘force-dynamic’ equal to revalidate of 0s

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search