Andrew Lee
Andrew Lee

Reputation: 29

Nextjs SSG slow at first load

I deployed a Nextjs app on Vercel. I found that the response time of the SSG pages with getStaticProps is slower in the first page load. The subsequent page load are instant. Why is this the case?

I expect that all page loads should be instant because they are cached in the CDN during build time. I am sure that the pages are SSG because I view them tagged as SSG in the build logs. What am I missing here? Thank you.

Upvotes: 1

Views: 1520

Answers (2)

Ranno Lauri
Ranno Lauri

Reputation: 36

The static files are not in the CDN on first request after building.

Pull-based CDNs load the data on the first request and keep it around until it expires. Vercel handles most aspects of our infrastructure like a pull-based CDN

Source

Upvotes: 2

Jawad Fadel
Jawad Fadel

Reputation: 838

The problem vercel server work like serverless if your website no one call him for a while Vercel will set your app to idle mode

Upvotes: 0

Related Questions