Vercel deployed site migrating to Netlify - Next.js - SSR - ISR - slow page rendering

Hi,
we are currently running on Vercel and are evaluating a switch to Netlify.
Our site is based on Next.js (latest stable version v12.1.0), it uses Middleware and is using ISR. This last one means pages are server-side rendered and served statically until the revalidate timer has passed. In our case, this is 10 minutes (revalidate = 600).
This can be viewed in this page Charity | Edgard & Cooper and requesting the response header x-vercel-cache. It is either “STALE” (meaning: it will be re-generated now) or “HIT” (meaning: served from cache, as static page).

After deploying the same deployed codebase to Netlify and accessing the same page (https://store-www.netlify.app/en/charity), the response header says: x-render-mode: ssr
I would have expected x-render-mode: isr
But this might be due to the fact we use Middleware.
I am looking for more information on the impact of Middleware and ISR (vs SSR).

More importantly, and that’s what we are investigating as the most important element: we experience much slower page serving (page renders) as on Vercel. We like to learn more on the differences and more importantly: what are our options to improve the page render speed?
Turning of the Middleware is no option, I’m afraid. We need it to validate geographic regions of the visitor.

Hey there, @hderoeck :wave:

Thanks so much for reaching out, and welcome to the Netlify Forums! Sorry to hear you are encountering obstacles. Can you please share your project repo as well as your most recent deploy log? I will surface this to a team member who can look into this for you.

What would be the best way to share our codebase and our deploy logs?

Hey @hderoeck,

You can add Hrishikesh-K on GitHub and we can take it from there.

However, for the time being, Middlewares are going to be slower than simple IS. This is because, Middlewares always hit Serverless Functions, even if the page is actually ISR. We’re working to change this, but because AWS Lambda is usually deployed in US-only (it’s not global), it’s going to be slower than normal ISR.

1 Like