Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Is there a CDN that pre-renders the app on the server?
2 points by kirillrogovoy on Oct 11, 2021 | hide | past | favorite | 6 comments
I got a crazy idea this morning.

What if there was middle-man (CDN, proxy, etc) that sits between the browser and the target service and, for each page request, it would act as a headless browser, visiting the target page, running all the JS and doing the rendering, and then dumping the DOM tree to HTML and serving it to the client (with zero JS)?

So the target app could be 100% JS-rendered but it'd look to the browser as though it's just a static HTML page.

(I know that the question then is "doesn't it mean that the website would end up not being interactive because the JS doesn't get delivered to the browser?", but I imagine use cases when it's not really a concern)

Is there any project on the Web that does anything remotely similar to this idea? The core thing is using a headless browser to do all the JS-initiated rendering on the server before the content hits the browser.




As a side note, I can imagine this approach being used for a customer-facing "proxy server".

E.g. there are people who disable JS by default and enable it for the websites they trust or when the page is completely dead without running JS.

I imagine an improved "Disable JS" function that (1) makes sure your browser doesn't run any JS but (2) ships a normally rendered page.


I am currently developing kind of what you're looking for! https://browser.staging.jimber.io You can interact with the browser on the backend (the headless one). But we could take out the 'small' part that renders the webpage in it's inital stage


I think basecamp is working on this kind of technology, but I think it is somewhat common for some performance focused shops to pre-render their initial HTML and cache it in their load balancer.

Basecamp I think is taking it a step further.. read more here: https://hotwired.dev/


Is Mighty Browser (https://www.mightyapp.com/) what you are looking for?


Thank you!

Somewhat similar but not really.

Mighty Browser seems to go one step further and does "head-full" browser rendering on the server while streaming you the video of it to your computer.

With my idea, the HTML rendering still happens on the user's computer within the user's browser.


this would be really inefficient, stuff like server side rendering for react is what's used




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: