How do Netlify handle generated static contents of a deployed NextJs site?

Hello there,

I have a NextJs site deployed to Netlify. I am using getStaticPaths with fallback: true from this NextJs tutorial in order to catch all incoming requests for /product/[id] path and generate a static page for first time visit.

When requests come in this path, the site will query the product info from our backend server with the [id] in getStaticProps then fill up the template with product info. It finally generates a static page for that product.

For example:
Someone access /product/food-a, the site will query info of food-a from backend and will generate a page food-a.html and food-a.json to the project directory. So everyone access the same path again can view the generated page directly without requesting backend.

My questions are:

  1. Is there any file count limit and total file size limit for generated content from a deployed site like this?
  2. I found after some period of time, some generated pages are seems being removed. Is it a Netlify behavior? If so, can I configure this in project setting?
  3. Can I browse and manage current project files of the site in admin panel?

No such limits

What do you mean, seems removed? Could you clarify?

You can browse the file structure: However, since each change needs a new deploy, there’s no way to update files without a new deploy.

Thanks for your clarification! I will try it out.

What do you mean, seems removed? Could you clarify?

For the remove problem, I dont really sure how it happened. The case I experienced was:

  1. After deploy, I browsed several pages like food-a, food-b and food-c to test the functionality.
  2. It generated html for these products and I did add a create timestamp in the html as well so I can see when the page was generated.
  3. I browsed same pages again and again to confirm the website was showing me the cached version. And it worked.
  4. In the next day, I browsed food-c again but it need to be generated again while food-a and food-b were still here.

As I didnt know how to view the website content before and I was not sure what I did in between the time, this behavior confused me to think some files “will seems be removed” under certain condition.

ps, My test site has ran for several days already but the same problem didnt happen again. I dont know how to reproduce it again also. Does it mean that is not actually a concern for us?

Are you using ISR? If yes, this is probably expected. “This” as in “generated again”.

I didnt add the revalidate field to the props returned inside getStaticProps. Can I assume ISR feature is not active in my case? but I will dig in deep about ISR to make sure it wont affect the page generation behavior. Thanks for your advice.

Without revalidate, there should not be ISR, correct. You could also check the response headers. If it says, x-render-mode: odb, then it’s most likely being treated as ISR.

1 Like

I see. I will keep track of the pages to see if the same problem happen in the future. Your information definitely helped a lot, Thanks for your help!

Sorry to get back to this question.

I just found out that NextJs will actually use Netlify functions to generate the product pages in our approach and there is a “Persistent pages or assets” limit under Netlify functions section in Pricing plan page.

Does it mean I can only have 10,000 generated product pages at the same time? And older pages will be deleted as new page comes in?

10,000 pages is what we can assure effective caching. More than that, might remain in cache, or might be dropped. Even if they’re dropped, a subsequent request will re-generate those pages and they’ll be cached.

I won’t count this as a limit for number of pages.

And at the moment, there’s no way to increase that limit.

1 Like

I see. Thanks for your information!

1 Like