Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream Rendering Roadmap #319

Closed
tlgimenes opened this issue Oct 9, 2023 · 2 comments
Closed

Stream Rendering Roadmap #319

tlgimenes opened this issue Oct 9, 2023 · 2 comments

Comments

@tlgimenes
Copy link

Hello there!

I'm currently working on an e-commerce platform using Preact as our trusty rendering framework, and we've been relying on preact-render-to-string for server-side rendering (SSR) of our websites. Everything's been running smoothly, but we've hit a bit of a speed bump when it comes to some of our longer pages, which pack in about 5,000 DOM nodes. SSRing these beefy pages is taking around 500ms with preact-render-to-string alone, and we're eager to optimize our time to first byte (TTFB).

At the moment, our only solution on the table is resorting to HTML stale caching. However, this isn't an ideal option, especially considering that some of our sites boast a whopping 11 million pages.

In my quest to find a more efficient approach, I delved into the world of Preact repositories and stumbled upon some exciting developments related to streaming. It appears that there's an ongoing effort in this direction, as evidenced by this work-in-progress pull request, as well as a few stalled PRs like 1, 2, and 3.

I then tried to find a roadmap outlining Preact's intentions regarding support for a streaming API, but unfortunately came up empty-handed. That's when I thought it best to reach out to you fine folks and inquire if this streaming feature is on your radar. Are there any plans to release it soon, or should I start exploring the stale caching + pre-rendering route?

Given the significant interest (and PR activity) surrounding this topic, it seems like quite the undertaking, but it's also clear that many of us are eagerly anticipating this feature. Additionally, I'd like to offer my assistance in implementing a simpler streaming strategy (without Suspense) if that's something you'd be interested in collaborating on.

Your insights and guidance would be greatly appreciated! 🚀

@JoviDeCroock
Copy link
Member

Hey!

I am personally very passionate about getting streaming rendering out of the door hence #296 is up for testing, I am looking for a good testbed application for it.

Is there a particular reason you are looking for streaming without Suspense, you need a trigger to flush and that seems like the best one we have at hand.

@JoviDeCroock
Copy link
Member

We have added renderToPipeableStream and renderToReadableStream in 6.5.0, this will be available under the new exports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants