I have a question:
I have a blog with a list of articles that could be modified.
I'm using nuxt with ssr:true
I'm building on netlify with the command: yarn build
And when I update the content (from Sanity CMS) the content on the page is updated (without webhook, that is super cool).
So my question is:
What's the difference between what I did and this?
routeRules: {
"/**": { isr: 60 },
},
I mean, the result is the same.
Is it better for performance?
So the difference is that your application is rendered on the server (nitro). This means that each time user visits your page, the server needs to send a request to all sources (like your CMS) and render HTML content based on it.
This works quite well as you mentioned without a webhook.
But the advantage of ISR is that you can have an application that is generated as a static app (no additional logic on the server necessary so it is just pure HTML, CSS) and only revalidate it when needed (for example when a content is updated in CMS).
So you get the advantage of static site generation (which is overall much better for performance) and still be able to have dynamic content being applied to your app through the usage of native caching.
The best usage of ISR is actually when you have a lot of pages (like e-commerce with milions of products) because there a build step will take ages and rebuild after changing some content in another place like CMS will take a lot of time as well. So ISR solves that issue because it only rebuild certain parts of your app when needed and everything else stays unchanged.
This is the magic of ISR 😃
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank you @jacobandrewsky for this post!
I have a question:
I have a blog with a list of articles that could be modified.
I'm using nuxt with ssr:true
I'm building on netlify with the command: yarn build
And when I update the content (from Sanity CMS) the content on the page is updated (without webhook, that is super cool).
So my question is:
What's the difference between what I did and this?
I mean, the result is the same.
Is it better for performance?
Hey, good question!
So the difference is that your application is rendered on the server (nitro). This means that each time user visits your page, the server needs to send a request to all sources (like your CMS) and render HTML content based on it.
This works quite well as you mentioned without a webhook.
But the advantage of ISR is that you can have an application that is generated as a static app (no additional logic on the server necessary so it is just pure HTML, CSS) and only revalidate it when needed (for example when a content is updated in CMS).
So you get the advantage of static site generation (which is overall much better for performance) and still be able to have dynamic content being applied to your app through the usage of native caching.
The best usage of ISR is actually when you have a lot of pages (like e-commerce with milions of products) because there a build step will take ages and rebuild after changing some content in another place like CMS will take a lot of time as well. So ISR solves that issue because it only rebuild certain parts of your app when needed and everything else stays unchanged.
This is the magic of ISR 😃