TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Is there a CDN that pre-renders the app on the server?

2 点作者 kirillrogovoy超过 3 年前
I got a crazy idea this morning.<p>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)?<p>So the target app could be 100% JS-rendered but it&#x27;d look to the browser as though it&#x27;s just a static HTML page.<p>(I know that the question then is &quot;doesn&#x27;t it mean that the website would end up not being interactive because the JS doesn&#x27;t get delivered to the browser?&quot;, but I imagine use cases when it&#x27;s not really a concern)<p>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.

5 条评论

kirillrogovoy超过 3 年前
As a side note, I can imagine this approach being used for a customer-facing &quot;proxy server&quot;.<p>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.<p>I imagine an improved &quot;Disable JS&quot; function that (1) makes sure your browser doesn&#x27;t run any JS but (2) ships a normally rendered page.
j_alex超过 3 年前
I am currently developing kind of what you&#x27;re looking for! <a href="https:&#x2F;&#x2F;browser.staging.jimber.io" rel="nofollow">https:&#x2F;&#x2F;browser.staging.jimber.io</a> You can interact with the browser on the backend (the headless one). But we could take out the &#x27;small&#x27; part that renders the webpage in it&#x27;s inital stage
milosonator超过 3 年前
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.<p>Basecamp I think is taking it a step further.. read more here: <a href="https:&#x2F;&#x2F;hotwired.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hotwired.dev&#x2F;</a>
shabda超过 3 年前
Is Mighty Browser (<a href="https:&#x2F;&#x2F;www.mightyapp.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.mightyapp.com&#x2F;</a>) what you are looking for?
评论 #28826702 未加载
wizwit999超过 3 年前
this would be really inefficient, stuff like server side rendering for react is what&#x27;s used