Chris Haynes - web developer consultant
With the advent of Declarative Shadow DOM (DSD) it is now possible to stream content in a static page that would have otherwised required API calls after the page has loaded. Using this technique will improve the perceived performance of static pages that have dynamic regions.
Consider the following contrived example that implements a socialy home page for our user, Alice.
The page itself has been pre-created using a text file compiler such as Gilbert. Previously, the page would have to load before API calls would go out and fetch content to populate profiles, news, weather, posts, etc. With DSD the server would make the first round of requests while the static page is streaming. Once completely streamed subsequent calls (to poll for news events for example) would be outbound from Alice's browser as normal.
It should noted that this does require some logic so you won't be able to get away with just NGinx, Caddy, S3+CloudFront, etc. But it can be achieved relatively easily with a Cloudflare Worker.













