\u003C/figure>\n\u003C!-- /wp:image -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>If you were to make a mistake on your site, let’s say you broke prod, you deployed the wrong brand colors, or you mixed up some copy, you can instantly rollback to a previous deploy without having to wait for a new build, because that old version of your site exists in space. It’s the same concept as reverting a commit in Git, and it works just as smoothly.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:image -->\n\u003Cfigure class=\"wp-block-image\">\u003Cimg src=\"https://lh4.googleusercontent.com/u73M4IZ4iUQa-jiaFbgwpqes0kAhhBjgBZV5GopUZdcrFGI0B8lK-wGc1CjqNSgtIoPrKZHyP68LmbO2KR8ukrIdT-9tVThlNMpozXwfgYUToYl-uqHBvzex8n7n25wO6yoxC-6o\" alt=\"Instant rollbacks mean you can choose any built deploy to go live at any time\" title=\"Instant rollbacks mean you can choose any built deploy to go live at any time\"/>\u003C/figure>\n\u003C!-- /wp:image -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>I won’t get into the details of the perks of pre-rendering all of your pages, but if you’d like to read more about that, you can check out more information on\u003Ca href=\"https://jamstack.org/what-is-jamstack/\"> Jamstack.org\u003C/a>.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:heading -->\n\u003Ch2 id=\"h-incremental-static-regeneration\">\u003Cstrong>Incremental Static Regeneration\u003C/strong>\u003C/h2>\n\u003C!-- /wp:heading -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Incremental Static Regeneration, or ISR, seeks to extend the power of static sites by adding some server-side rendering (SSR) goodies on top with the power of a Node server.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:block {\"ref\":17975} /-->\n\n\u003C!-- wp:heading {\"level\":3} -->\n\u003Ch3 id=\"h-how-it-works-and-why-it-s-cool\">\u003Cstrong>How it works and why it’s cool\u003C/strong>\u003C/h3>\n\u003C!-- /wp:heading -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>When you deploy a site with ISR enabled, you deploy a (mostly) static site. You have your pre-defined static pages that were built, and you have routes on your application that aren’t built until your users hit those pages.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Typically when you have a server-side rendered (SSR) page that is one of these unbuilt pages, your users have to wait for the page to be built and served all at once. But in the case of ISR, if your users hit that route, they get a \u003Cem>fallback page\u003C/em>. A fallback page is a placeholder for the actual content that will be on that page, and you can have skeleton components in place until data is built and loaded. Once that data has been resolved, that page is cached, added to the rest of the site’s bundle, and the next user of your page will see the built page. If the data needs to update, the user will see that cached version instead of the fallback, and the site can set a \u003Cem>revalidate timeline\u003C/em> so that it can revalidate and update data regularly when your users hit the page.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:image -->\n\u003Cfigure class=\"wp-block-image\">\u003Cimg src=\"https://lh6.googleusercontent.com/ZVG0Ml7P3pL1B14X3TNA1BOfi-z3s1pk2mwHZBN2jfXYvQWGzS4pmMUg3Dxt9xhpIj8eqLIuBg9nYJAX4oJKQwrXEBLZ1ts5hhj9tvuQqWMOvC_hTQhw0eNUp6w-9tr4oSDwgoUF\" alt=\"Incremental static regeneration adds new pages to the latest deploy and caches them separately\" title=\"Incremental static regeneration adds new pages to the latest deploy and caches them separately\"/>\u003C/figure>\n\u003C!-- /wp:image -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Each of the new blocks in this diagram is a new page that is built at runtime and added to the “stack.”\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>This method of serving pages is using the\u003Ca href=\"https://web.dev/stale-while-revalidate/\"> stale-while-revalidate\u003C/a> caching strategy. It’s pretty dang performant, because you can (nearly) get the performance benefits of a pure static page, with the power of new dynamic data like you would in SSR. That’s why this strategy is very often called “hybrid” development, because it combines the best of both worlds!\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:heading {\"level\":3} -->\n\u003Ch3 id=\"h-why-it-s-not-great\">\u003Cstrong>Why it’s not great\u003C/strong>\u003C/h3>\n\u003C!-- /wp:heading -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>There’s a few flaws in ISR that you might want to consider before going all-in on the concept.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>When you have a user come to your page, you want them to see the most up-to-date version, immediately. With ISR, the first visitor to a page will not see that. They will always see a fallback first. And then later, if the data gets stale, the first visitor to see that cached page will see the out-of-date data first before it revalidates. Once again, this inconsistent experience can be pretty difficult to debug if your users experience negative side-effects as a result of old/unbuilt pages.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:image -->\n\u003Cfigure class=\"wp-block-image\">\u003Cimg src=\"https://lh4.googleusercontent.com/Kvh-y_pW5uwmMntpwjDDnepjtlqGo4lGbldfWP3UIZm1B_KwFIXjdth1IMLSTdGKDJJFAIagI8pB7EehWQTWV-om99uXqshpJEur1ml3N_eB1KFvmtkCATwyCCYGpkkBn2UtqhsV\" alt=\"Pages can get stale, but they'll stay deployed\" title=\"Pages can get stale, but they'll stay deployed\"/>\u003C/figure>\n\u003C!-- /wp:image -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Remember the whole section up there of atomic and immutable deployment? ISR, unfortunately, breaks that model. By adding extra pages to your bundle, rollbacks can no longer be instant, and you no longer have that single new version of your site when you update your content.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Let’s say you build a site that has a bunch of products for sale, and each of those products are on ISRed pages. In an ideal scenario, your users can navigate to a products’ page, see a product for sale, and buy it. The next users who go to the page will see it, and the page might update to show that the product is out of stock.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>If you rollback your site to a different deploy, because your page is cached separately from the bundle, it could exist in a different state for your user than expected. It could be the old version of the site, the new version, or some funky in-between cached version trying to revalidate itself. And unfortunately, debugging this is difficult, because different users (and the dev team!) would see different pages, and it might be difficult to duplicate.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:image -->\n\u003Cfigure class=\"wp-block-image\">\u003Cimg src=\"https://lh6.googleusercontent.com/LI9vFD2R6uxvsFe2GXLbJiwzufv_5Y-56CouIeVT6cuZVLd4bGJLuKm2Tw-DnpAy6XFjx2wHtR_J0yFRrfPN2cUJKqXIkJvqOE_Ny9TZ0pmqcjaQPxIFyUKSH3_2jqaPsZbq5GCr\" alt=\"ISR means that you can rollback, but the stale/separately cached pages will stay live\" title=\"ISR means that you can rollback, but the stale/separately cached pages will stay live\"/>\u003C/figure>\n\u003C!-- /wp:image -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Notice how in this graphic, the pages that are cached separately stick around with their nice big checkmarks, while the rolled-back page is no longer the shipped deploy. If the users navigate to those cached routes, they might see out-of-date data.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>The stale-while-revalidate caching that powers ISR is the reason for these gotchas. When ISR is based on serving stale content like this, we end up with a pretty big footgun that ultimately is confusing for users and frustrating for developers.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:heading -->\n\u003Ch2 id=\"h-what-should-i-do-for-my-projects\">\u003Cstrong>What should I do for my projects?\u003C/strong>\u003C/h2>\n\u003C!-- /wp:heading -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>✨ It Depends ✨\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Pros:\u003Cbr>- Faster build times\u003Cbr>- Performant pages taking advantage of a Node server as well as a cached static model\u003Cbr>\u003Cbr>Cons:\u003Cbr>- Inconsistent pages per user (breaking atomic and immutable deploys)\u003Cbr>- Difficult to debug due to stale-while-revalidate caching\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Clearly there are benefits to ISR, but it does come with caveats! Weigh the pros and the cons and decide for yourself if it’s right for you.\u003C/p>\n\u003C!-- /wp:paragraph -->","html","2021-05-17T14:05:40.000Z",{"current":416},"incremental-static-regeneration-building-static-sites-a-little-at-a-time",[418,426,430,435],{"_createdAt":419,"_id":420,"_rev":421,"_type":422,"_updatedAt":419,"slug":423,"title":425},"2023-05-23T16:43:21Z","wp-tagcat-code-for-a-living","9HpbCsT2tq0xwozQfkc4ih","blogTag",{"current":424},"code-for-a-living","Code for a Living",{"_createdAt":419,"_id":427,"_rev":421,"_type":422,"_updatedAt":419,"slug":428,"title":429},"wp-tagcat-jamstack",{"current":429},"jamstack",{"_createdAt":419,"_id":431,"_rev":421,"_type":422,"_updatedAt":419,"slug":432,"title":434},"wp-tagcat-static-sites",{"current":433},"static-sites","static sites",{"_createdAt":419,"_id":436,"_rev":421,"_type":422,"_updatedAt":419,"slug":437,"title":439},"wp-tagcat-web-development",{"current":438},"web-development","web development","Incremental Static Regeneration: Building static sites a little at a time",[442,448,450,456],{"_id":443,"publishedAt":444,"slug":445,"sponsored":12,"title":447},"5ff6f77f-c459-4080-b0fa-4091583af1ac","2025-08-20T14:00:00.000Z",{"_type":10,"current":446},"documents-the-architect-s-programming-language","Documents: The architect’s programming language",{"_id":16,"publishedAt":17,"slug":449,"sponsored":12,"title":20},{"_type":10,"current":19},{"_id":451,"publishedAt":452,"slug":453,"sponsored":12,"title":455},"f0807820-02d7-4fc5-845f-3d76514b81c0","2025-08-11T16:00:00.000Z",{"_type":10,"current":454},"renewing-chat-on-stack-overflow","Renewing Chat on Stack Overflow ",{"_id":457,"publishedAt":458,"slug":459,"sponsored":12,"title":461},"e33464c4-b21b-4019-8b86-64a46335a95e","2025-08-07T16:00:00.000Z",{"_type":10,"current":460},"a-new-worst-coder-has-entered-the-chat-vibe-coding-without-code-knowledge","A new worst coder has entered the chat: vibe coding without code knowledge",{"count":463,"lastTimestamp":464},2,"2023-05-25T09:47:33Z",["Reactive",466],{"$sarticleModal":410},["Set"],["ShallowReactive",469],{"sanity-_z6ScRlGqPdFlSmPYyklDV-YkINohDlX_QqTm2M94vs":-1,"sanity-comment-wp-post-18081-1755710854747":-1},"/2021/05/17/incremental-static-regeneration-building-static-sites-a-little-at-a-time/?cb=1"]