惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
A
About on SuperTechFans
H
Help Net Security
Engineering at Meta
Engineering at Meta
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
WordPress大学
WordPress大学
MongoDB | Blog
MongoDB | Blog
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
C
Check Point Blog
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
I
InfoQ
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The GitHub Blog
The GitHub Blog
Last Week in AI
Last Week in AI
D
Docker
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 叶小钗
Jina AI
Jina AI
F
Fortinet All Blogs
宝玉的分享
宝玉的分享
小众软件
小众软件
有赞技术团队
有赞技术团队
F
Full Disclosure
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Recorded Future
Recorded Future
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
量子位
U
Unit 42
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
V
V2EX
O
OpenAI News
S
Secure Thoughts
罗磊的独立博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Google Online Security Blog
Google Online Security Blog
Cloudbric
Cloudbric
W
WeLiveSecurity
IT之家
IT之家

CloudCannon Blog

Building with AI: Git-based vs headless vs traditional CMS CloudCannon + Astro: performance meets powerful content management Introducing the Astro Component Starter Introducing Jetstream — built on the Astro Component Starter Why we switched to the system font stack Redesigning CloudCannon’s docs with Diátaxis, Lume, and Pagefind Make content editing more visual: upgraded Editable Regions How Configuration Mode makes building editing interfaces easy Your hosting just got an upgrade (and a price cut) Custom testing domains for professional branding Keep your content consistent with input validation Managing multilingual content in CloudCannon Simplify team publishing with conflict resolution and domain tools Open Beta: Publishing Conflict Resolution Getting started with CloudCannon and Astro: Bookshop, components, and live editing Welcome to the CloudCannon Community! Omnichannel delivery is just marketing spin from API-based CMS companies Getting started with CloudCannon and Astro: Snippets and Collections Managing digital assets in CloudCannon: a guide to smart asset storage Understanding CloudCannon's branching workflows and Projects: a complete guide What is a static website? CloudCannon’s 2024 wrapped Getting started with CloudCannon and Astro: WYSIWYG blogging Jamstack vs. WordPress: reasons to make the change The top five static site generators for 2025 (and when to use them!) Free Jekyll themes for 2025: ten great community options Eleventy (11ty) vs. Hugo How to set up WYSIWYG editing with MkDocs Material The rise of static-first websites: why major brands are making the switch Watching your Core Web Vitals on Jamstack Understanding the difference between static, dynamic, and hybrid websites Looking for an alternative to Netlify CMS or Decap CMS? Designing components for your website editors: a CloudCannon case study Does my website look big in this? Six tips to lower your page weight Content is sacred — so own your revision history The eternal balancing act: load time vs. delay time Streamlined Headless Mode, Unified Configuration, and live data editing What is a headless CMS? Looking for a TinaCMS or Tina Cloud alternative? The ultimate guide to Hugo Sections Coming soon: Live config editing and data reloading Faster publishing workflows out now! Why information architecture matters for your website Website UX vs SEO: picking your battles Easily manage your multilingual Astro site in CloudCannon How you can optimize publishing workflows for your content team How you can optimize your CMS for SEO success How you can optimize your Content Editor for long-form articles How you can optimize your Visual Editor for page building Secure, swift, and stable: static sites for the financial sector Enhanced flexibility for teams with Custom Permissions Building static sites that scale The Inaugural 11ty International Symposium on Making Web Sites Real Good How to manage hundreds of connected websites with a Git-based headless CMS How we’re building CloudCannon for accessibility CloudCannon’s new editing improvements are here! Open Beta | New ways to collaborate on editing your websites Top 11 free Eleventy themes for 2024 Top 10 free Astro themes to use in 2024 Why choose a Git-based headless CMS over a monolithic DXP in 2024? Learning web development: a self-guided roadmap Partner Site of the Month: Blüthner Piano Centre, by Winteractive CloudCannon’s 2023 wrapup Let’s create a microblog with visual editing using Bookshop and Eleventy Update and visualize your branches with CloudCannon Projects What is a Git-based CMS and why you should use one CloudCannon secures SOC 2 certification The complete guide to growing your web development agency Automatically optimize your images with Eleventy Image and CloudCannon Share components and syndicate content with Site Mounting Partner Site of the Month: Cru Uncorked, by Ed Meehan New web component for responsive HTML tables Wrapping up HugoConf 2023 Partner Site of the Month: Van Dillen Antieke Bouwmaterialen, by Fulldev How to become a freelance web developer: a comprehensive guide Q3 2023: CloudCannon features and improvements 22 ways to deliver more value to your web development clients Partner Site of the Month: DC Gay Flag Football League, by Ed Cupaioli A new way to configure your CloudCannon sites CloudCannon — the official CMS partner of Eleventy Full CloudCannon support for Nuxt static sites Partner Site of the Month: Stadium Bike, by Insight Creative, Inc. HugoConf 2023, brought to you by CloudCannon DAM Support for Cloudflare R2 and DigitalOcean Spaces Eleventy (11ty) vs. Gatsby in 2023 – which SSG is best for you? How CloudCannon’s live editing works with Astro and Bookshop Partner Site of the Month: Fiducian, by Croissant & Baguette Eleventy (11ty) vs. Astro How to customize CloudCannon’s Client Sharing interface Let anyone, anywhere, edit your CloudCannon sites Top 23 free Astro themes for building out-of-this-world static sites in 2023 How Jampack optimizes our Eleventy website and improves performance Astro vs. Next.js CloudCannon.com is now built with Eleventy! Out-of-this-world support for all Astro users Introducing the CloudCannon Partner Program Full CloudCannon support for Gatsby Top 10 Free SvelteKit Themes for Building Lighting-Fast Static Sites in 2023 Enhanced CloudCannon support for Next.js users Upcoming CloudCannon Interface improvements (Open Beta)
The case for Distributed Persistent Rendering
2021-05-17 · via CloudCannon Blog

As Jamstack adoption grows, we're seeing the limits of static sites put to the test. Excessive build times on large-scale sites are a hot topic and a problem that needs solving for Jamstack to become mainstream. Netlify has recently introduced a feature and spec for Distributed Persistent Rendering (DPR). It's a hybrid approach to serving sites - a portion of pages are prerendered, the rest render on-demand to decrease the upfront build time. It's a fascinating idea that begs many questions. Are these sites static? Have we come full circle? Why not just have a dynamic site at this point?

In this article, I'd like to explore how we got here and what DPR means for the future of Jamstack.

How we got here Direct link to this section

It's human to strive to make something better and more useful than it was yesterday. This constant drive to improve has taken us from cave-dwelling mammals to creating a microwave that syncs with our phones. New functionality often comes with complexity, and we're continuously reinventing technology to maintain this balance. We see this in everything from cars, to phones, to the lights in our home, and we certainly see it with websites.

In the beginning, all websites were static. As the web grew in popularity, so did the size and complexity of websites. It quickly became apparent that managing large sites with pure HTML was unmaintainable. Not only that but there was also an increasing number of people who didn't know HTML, who wanted to create content for the web. To solve this, we put content in databases and used programming languages to piece together a page when it's requested. To this day, this is how the majority of websites on the internet function.

Dynamically generating website pages on the fly is powerful because it gives you ultimate control. You can run code to detect someone is from Reykjavik, Iceland, check a weather API and discover it's raining there, query your database for rain-related activities and deliver the page back to the user in seconds. With a database, you can easily have millions of content pages, which would be an impossible task to maintain on a purely static site. The problem comes with complexity. There's a whole stack of technologies that need to work together to generate a page - backend language, database, caching layer, security and SEO plugins, the list goes on. The more moving pieces, the more that can go wrong, and the broader the skill set web developers need to build websites.

The reinvention to address this complexity came in two forms: flat file CMS's and static site generators.

A flat file CMS removes the database from the stack and uses text files for content. Working with plain text files is a lower technical barrier to setting up and managing a database and removes a potential bottleneck. You still have all the other pros and cons of a dynamic system.

Static site generators (SSGs) address one of the significant downsides of a purely static website - maintainability. They have many of the features you get with a dynamic solution like layouts and includes. However, instead of running this logic on-demand, it's run in an upfront build step that generates a static site. Static sites are fast, secure, easy to scale, and straightforward, so it's easy to see why this approach has gained momentum. "Jamstack" was coined to talk about this approach without the limiting perception of the word 'static.'

As more people learn the benefits of Jamstack, so does the size of the use cases. We're seeing blogs and e-commerce sites with hundreds of thousands of pages making the jump to Jamstack. Developing a site of this scale in an SSG like Jekyll or Gatsby could result in excruciating long build times, possibly hours. Waiting an hour for a build isn't a productive way to work, so what are the options?

Strategies for reducing Static Site Generator build times Direct link to this section

We currently have several tools for reducing build time on SSGs:

Build Caching - Hugo has a feature called partial caching. It allows a partial (or include) to be cached, so it doesn't need to be re-rendered every time it's called. Most SSGs will have a feature similar to this. For something like navigation which doesn't change much, this can reduce the build time immensely.

Incremental builds - Many SSGs have incremental builds, which create a dependency tree of the site after a build. When a file changes, the SSG can look at the dependency tree to see which files are impacted and only rebuild those files. Fewer files to build = faster build times. This sounds like a silver bullet in theory, but doing it well is a lot harder than it sounds. There's plenty of cases that will miss regenerating a page which leads to stale content. If you touch the main layout, you're still going to have to build the entire site.

Sharding - This is the idea of splitting one logical site into multiple sites and then mounting them back together when it's served. We do this for our marketing site for CloudCannon. We have separate Jekyll sites for the main marketing pages, blog, documentation, and community which all use the same theme. Then we use subpaths to serve them as a single logical site. Updates to the community site build quickly while the blog takes a bit longer. It's a situational solution. If you have a large blog, it probably doesn't make sense to shard it.

SSG - Your choice of SSG can have a considerable impact on build time. Hugo is known for fast build speeds - there are real-world use cases of building 75k content pages in under 15 seconds. Doing this in most other SSGs will take minutes, if not hours.

What is Distributed Persistent Rendering, and how does it work? Direct link to this section

As mentioned earlier, Distributed Persistent Rendering is a new approach to addressing long build times on large sites. A portion of pages are prerendered, the rest render on-demand. When an on-demand page is requested, the web server runs the SSG to generate a single page (currently, only Nuxt and 11ty support this). Ideally, the webserver will have an aggressive cache, so only the first visit will render on-demand.

Why would I want to do this? Direct link to this section

Looking at the "Strategies for reducing SSG build times" above, it becomes apparent that all of these solutions are situational:

  • Build caching works well for content that remains relatively static between pages.
  • Incremental falls down if you have to touch a layout that all pages use.
  • Sharding only makes sense in specific scenarios.
  • While Hugo is fantastic, we can't use it for everything.

DPR is interesting because it's a less situational strategy than the other options. You're trading a shorter upfront build time for some complexity and a small overhead on the long tail of pages.

There are some caveats to be aware of with DPR. If you have time-sensitive logic like pulling from an API or outputting a date, there's no guarantee exactly when the page will build.

Does using DPR make a static site, dynamic? Direct link to this section

What is a static website? It's a surprisingly nuanced question. At one end of the spectrum, you have a purely static site. The HTML that the developer saves in their code editor is exactly the same as the HTML the browser renders. We can all agree this is a static site. But what about a SPA that requests data on load? A flat file CMS with an aggressive cache in front of it? Outputting a static website from a WordPress site?

The keyword for me is prerendering. If the webserver essentially serves files without generating anything, it's static. Anything else, you might have many of the advantages of a static, but I'm hard-pressed to call it a static site. With on-demand generation, it's a stretch to call a site using DPR a static site. It's essentially making an SSG into a flat-file dynamic site. However, it's a strategy that does a good job of maintaining the benefits of a static site:

  • Performance - The first request will have overhead, but after that, it will be cached. There's nothing particularly unique about what DPR is doing here. You could do this on any dynamic site.
  • Security - The only piece of information the on-demand builder needs to know is the file to generate. There's not a lot a malicious user could exploit.
  • Straightforward - You don't need to build a Jamstack site with DPR in mind. It's something that happens at the hosting layer.

How does Distributed Persistent Rendering compare with Incremental Static Regeneration? Direct link to this section

Incremental Static Regeneration (ISR) is a way of updating a static page without rebuilding the entire site. While this definition sounds similar to DPR, there's a subtle difference. ISR is a stale-while-revalidate caching strategy. It will serve stale content while generating the page in the background. The advantage of this is you don't have a slower response on the first request to a page—the disadvantage predictability. If I update a page, I can't guarantee when that content will be live on the website.

What DPR means for Visual Jamstack CMSs Direct link to this section

This is a technology that's particularly interesting for CloudCannon as a visual CMS for Jamstack sites. When users update website content on CloudCannon, they have to wait for their entire site to build before making another change. With this technology, we can significantly reduce the waiting time by rebuilding an individual page.

We hope more SSGs jump on to support DPR. Kudos to Netlify for making an open spec we can all build on.