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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A Gentle Introduction to SSR

46 点作者 jgalvez大约 3 年前

10 条评论

zmxz大约 3 年前
It feels like we&#x27;re running in circles.<p>We used languages like PHP&#x2F;Ruby to produce HTML&#x2F;CSS that browser renders. Then Microsoft introduced XHR. Then we started with &quot;saving bandwith&quot; and &quot;page does not to be reloaded&quot; and AJAX was born (although it was Asynchronous HTTP and HTML instead of XML). Then such sites weren&#x27;t indexed by Google so we started to pre-render content again for the most visited URLs.<p>And now there&#x27;s so many buzzwords and bland excuses about server side rendering, such as &quot;SSR improves user experience: users don&#x27;t have to wait for CPU-bound JavaScript to run on the client&quot;.<p>JavaScript itself is not what makes websites slow. It&#x27;s the 50 megabytes of advertising material I&#x27;ve to load from various &quot;content delivery networks&quot; that are everything except fast and auto-play videos that I&#x27;m not interested in.<p>Today&#x27;s personal computers are stupidly fast, smartphones too. There&#x27;s so little gain in the argument that pre-rendering the first request on the server improves performance while it does nothing for the network-related problems (resolving the domains and transferring so much content).<p>SSR is great, don&#x27;t get me wrong, but the reasoning that encourages devs to use it is misplaced (not WRONG, misplaced).<p>Yes, it does improve user experience, but it doesn&#x27;t do so because our computers are slower in parsing and executing JavaScript.
评论 #31250884 未加载
评论 #31246657 未加载
评论 #31246941 未加载
评论 #31247127 未加载
zelphirkalt大约 3 年前
&gt; Server-Side Rendering comprises various techniques involved in running JavaScript universally or as some like to say, isomorphically, that is, both on the server and on the client [...]<p>I am like: &quot;Did they just redefine SSR to limit its meaning to something JS specific, when it was the default for decades?&quot; Then:<p>&gt; [...] — in order to pregenerate markup for delivery and spare the browser from having to do so dynamically on page load — this is my definition, you&#x27;ll find many others, but I think this captures the gist of it.<p>Ahhh, their own definition! OK, it is rather weird to limit SSR to be something JS specific, when people have been talking about rendering HTML on the server side for decades. Most web frameworks are able to make use of some kind of templating language, of which there are hundreds, if not thousands. Often they are interchangable and not a hard dependency of the web framework.
评论 #31246356 未加载
评论 #31246973 未加载
评论 #31246597 未加载
评论 #31247536 未加载
bjarneh大约 3 年前
We need to find another term for this (Server Side Rendering = SSR). SSR is starting Firefox on a server with X-forwarding or something. How is producing a complete HTML document on the server = rendering? Then PHP has been rendering webpages for years.<p>Offloading the actual rendering-engine from gluing together the HTML document from parts fetched or produced by Javascript prior to actually rendering the webpage can probably be a good idea in some instances. But this is hardly a new technique. Using Javascript to do it doesn&#x27;t make it something different than PHP or the good old CGI scripts in Perl&#x2F;Python.
评论 #31247144 未加载
评论 #31246865 未加载
评论 #31247200 未加载
_han大约 3 年前
I recently learned about SvelteKit&#x27;s (<a href="https:&#x2F;&#x2F;kit.svelte.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;kit.svelte.dev&#x2F;</a>) solution to mixing SSR with dynamic components: The dynamic component is rendered at the server, but the data that it&#x27;s based on is included with the HTML. So, after the page loads, it converts the static HTML into a dynamic component using the data, in a process called &#x27;hydration&#x27;: <a href="https:&#x2F;&#x2F;kit.svelte.dev&#x2F;docs&#x2F;appendix#hydration" rel="nofollow">https:&#x2F;&#x2F;kit.svelte.dev&#x2F;docs&#x2F;appendix#hydration</a>
评论 #31246908 未加载
评论 #31246101 未加载
评论 #31246470 未加载
评论 #31246137 未加载
anyfactor大约 3 年前
I expected this to be an ELI5 easy to read explanation of SSR because it mentioned &quot;gentle introduction&quot;. But the explanations and keywords in the articles would demand their own &quot;gentle introduction&quot;.<p>How the heck this is a gentle introduction of anything.<p>&gt; Server-Side Rendering comprises various techniques involved in running JavaScript universally or as some like to say, isomorphically, that is, both on the server and on the client — in order to pregenerate markup for delivery and spare the browser from having to do so dynamically on page load — this is my definition, you&#x27;ll find many others, but I think this captures the gist of it.<p>Maybe I am too stupid, but I would rather read a wikipedia article on SSR at this point.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Server-side_scripting" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Server-side_scripting</a>
jdrc大约 3 年前
What if we just implemented PHP on the browser instead?
评论 #31246458 未加载
m12k大约 3 年前
In this context, SSR is Server-Side Rendering, not Screen Space Reflections.
评论 #31246126 未加载
评论 #31246150 未加载
评论 #31246277 未加载
trhoad大约 3 年前
@Author, nice article, but the bold yellow italics make reading quite difficult (e.g. Why is &quot;gist&quot; emphasised?).
评论 #31246539 未加载
评论 #31246586 未加载
terrycody大约 3 年前
Hey, Regard &quot;SSR improved ranking&quot; :<p>I think this is a myth. I mean, that simply means those static websites will rank better than dynamic sites, and in fact, this seems not real. But I get the idea, if improved the speed, thus SHOULD in theory, improve the ranking.
kookamamie大约 3 年前
Was hoping to read about Screen-Space Reflections.