TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The absurd complexity of server-side rendering

361 pointsby takiwatangaabout 3 years ago

54 comments

codedokodeabout 3 years ago
There are cases when server-side rendering (without SPA) is easier and faster. For example: documentation sites, blog-like sites, internet stores, sites like Hacker News. In all these cases, you can save on development time by writing just one application instead of two (server and client), and improve performance (no need to load multimegabyte JS applications and make multiple AJAX requests to display a page).<p>Of course, there are cases when SPA-style application is better, for example: (graphic&#x2F;circuit&#x2F;text) editors, IDEs, mobile newsfeed-based apps - everything that resembles an app rather than a page with text, menus and images. But in these cases you usually don&#x27;t need server-side rendering. And sometimes you cannot even use it - for example, if your code needs to know browser windows size to arrange objects on the page.<p>So I think that SSR (running JS on server) is rarely useful.
评论 #31090801 未加载
评论 #31093230 未加载
评论 #31094057 未加载
评论 #31093094 未加载
评论 #31096281 未加载
评论 #31091866 未加载
评论 #31090640 未加载
评论 #31093713 未加载
评论 #31092133 未加载
评论 #31095867 未加载
评论 #31090669 未加载
bob1029about 3 years ago
I&#x27;ve been saying it for years - the hard part is not &quot;server side&quot; vs &quot;client side&quot;, it&#x27;s making sure the state stays consistent between those 2 buckets.<p>If you want to remove the hell from your life, you need to be all in on one or the other.<p>For us, we&#x27;ve been keeping all state server-side using things like Blazor and hand-rolled js-over-websocket UI frameworks. We never have to worry about more than ~10k users, so this works out great for us.<p>If we were webscale, we&#x27;d have to consider client side options.
评论 #31089852 未加载
评论 #31090766 未加载
评论 #31091267 未加载
评论 #31090634 未加载
评论 #31091748 未加载
评论 #31094225 未加载
评论 #31093517 未加载
评论 #31089872 未加载
jwrabout 3 years ago
I&#x27;ve been using server-side rendering for many years now and I find it to be almost zero overhead at this point. Yes, I had to do some initial work to set things up, but these days I don&#x27;t even remember it&#x27;s there.<p>Most people make an assumption that in order to have SSR you need to run JavaScript (e.g. Node most of the time) on your backend. That is not a valid assumption.<p>I think the title of the article could benefit from adding &quot;using Node&quot;, because much of the complexity described is something I do not encounter at all. I&#x27;m using Clojure and ClojureScript with Rum as a React interface. Much (if not most) of my code is in cljc files, which get compiled with Clojure (for JVM on the backend) or ClojureScript (for JavaScript on the frontend). And the ClojureScript advanced compilation takes care of only including what is strictly necessary in the frontend compiled JavaScript.<p>I mean, sure, you need to be careful not to do stupid things like trying to read from files, but otherwise I just don&#x27;t encounter much friction. And I reap the benefits of using a single language for both backend and frontend, with most of my data model (e.g. business logic) code written only once, with SSR being a nice cherry on top.
评论 #31094221 未加载
评论 #31094340 未加载
franzeabout 3 years ago
I make a difference between website and webapp.<p>a website is a collection of webpages, where the maingoal is to display some mostly static information (i.e. an article)<p>a webapp has the main goal of managing and reacting to a complex, non trivial user state.<p>website, go server side all in, do not add the tax of client side rendering &#x2F; hydration to the frontend. if necessary embed small enclosed client side webapps on the frontend.<p>webapp, go client side all in, screw server side rendering.<p>yes, you can marry website and webapp via server side rendering &#x2F; hydration. but the cost to make this really really fast and spiralling complexity and edge cases, does not make it worth it.<p>choose the right tool for the job, and just because it has web** in its name, does not make it automatically a job for react&#x2F;angularjs&#x2F;newest-coolest-framework
评论 #31094342 未加载
评论 #31095397 未加载
评论 #31094496 未加载
评论 #31095919 未加载
评论 #31094329 未加载
geenatabout 3 years ago
<a href="https:&#x2F;&#x2F;htmx.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;htmx.org&#x2F;</a><p>Having spent 36+ years in the computer industry, I consider the advent of htmx to be the first thing in web development to to attempt to pull the industy&#x27;s head out of it&#x27;s ass.<p>Don&#x27;t forget to include a solid remake of css in your project like tailwindcss. It also makes code much more readable.
评论 #31091673 未加载
评论 #31094237 未加载
评论 #31093931 未加载
评论 #31092107 未加载
评论 #31092546 未加载
评论 #31095930 未加载
评论 #31093147 未加载
评论 #31092336 未加载
评论 #31093960 未加载
diego_sandovalabout 3 years ago
&gt; After a fashion, it was decided that sometimes our HTML is best rendered by JavaScript, running in a user&#x27;s browser. While some would decry this new-found intimacy, the age of interactivity had begun.<p>I didn&#x27;t get the memo when this was decided, and I&#x27;m still unconvinced.<p>Let me see if I get this straight:<p>The main reason for client-side rendering is that some web applications don&#x27;t want to do a full page reload every time that there&#x27;s a non-trivial state change (usually triggered by user interaction). When the inherent complexity of the application means that there are state changes pretty often, doing a page reload so often would just kill the user experience, and using jQuery or similar libraries would lead to a spaghetti.<p>Is that the reason for client-side rendering being the &quot;default&quot; in the realm of modern javascript?<p>If that&#x27;s the actual reason, then that seems reasonable, but I think that Javascript culture (frameworks, tutorials, articles) usually erroneously assumes that every application is a complex one with tons of state changes, thus assuming that client-side rendering is the only right way to develop an application (without counting &quot;isomorphic&quot; SSR which is just another way to create a spaghetti).<p>Sure, if I don&#x27;t like it I can just move over to Django, Laravel, etc. but it feels like I never get an actual explanation of <i>why</i> client-side rendering is the default in these js frameworks, it&#x27;s just accepted as a fact of life.
评论 #31092386 未加载
评论 #31093952 未加载
评论 #31093930 未加载
评论 #31092853 未加载
toredabout 3 years ago
Except for the confusion about terminology the article has some good points.<p>We had an idea a long time ago in the web dev world that we could run the same language in the browser and in the backend. Basically reuse everything and save time.<p>It think this is bad assumption to begin with.<p>If I have a clean separation between frontend and backend, regardless if doing mostly server rendering or client rendering it is only one thing that makes sense to share, input validation code.<p>Like what is the definition of a first name, last name, age, price, email address etc. That is the one thing that need to be in agreement between the frontend and the backend to be able to exchange data.<p>But to share frontend and backend technology for only the gain of input validation seems like a heavy price to pay for little gain.
评论 #31094281 未加载
评论 #31094537 未加载
silviogutierrezabout 3 years ago
Shameless plug: If you want seamless SSR with Django logic, but React templates, check out my project at <a href="https:&#x2F;&#x2F;www.reactivated.io" rel="nofollow">https:&#x2F;&#x2F;www.reactivated.io</a> .<p>It&#x27;s like HTMX but uses React, and the JS bits <i>are</i> rendered on the server. You can then hydrate on the client.<p>The Reactivated docs site itself uses the project: <a href="https:&#x2F;&#x2F;github.com&#x2F;silviogutierrez&#x2F;reactivated&#x2F;tree&#x2F;main&#x2F;website" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;silviogutierrez&#x2F;reactivated&#x2F;tree&#x2F;main&#x2F;web...</a>
评论 #31092355 未加载
Daishimanabout 3 years ago
The complexity of web development frontend itself is just absurd. The mess of dependencies, the mess of language transpiling, opaque abstract functions with unreadable call stacks, asset management, sync vs async, the random best practice of the week, etc.<p>I look at the state of web pages and apps and it&#x27;s not even for the betterment of user experience! Hacker News and old.reddit.com still provide the smoothest, fastest experience at the cost of having to zoom in every once in a while, but the price is worth it.
评论 #31089335 未加载
评论 #31088956 未加载
评论 #31089731 未加载
评论 #31090416 未加载
kraig911about 3 years ago
I gave it a shot at one startup using next.js that wanted to pre-hydrate redux state, but also use tracking with session cookies et al the regular bag of beans. I spent maybe 6 weeks on it and basically I grew to realize I was in a miasma of pain. I didn&#x27;t last much longer. I could&#x27;ve wrote the entire thing just vanilla js&#x2F;css in probably a weekend...<p>So I can commiserate with this.
评论 #31090837 未加载
评论 #31089915 未加载
jvanderbotabout 3 years ago
I opened this thinking it would lament the challenges of server side frameworks and templating.<p>But those things seem so, <i>so</i> sane and simple compared to the mess I just read about. It&#x27;s worse than I could have imagined.<p>Who thinks that&#x27;s a good workable solution? Who&#x27;s idea was this?
评论 #31089859 未加载
donatjabout 3 years ago
Call me old fashioned, but PHP still gets the job done better than just about anything else.
评论 #31096074 未加载
评论 #31089375 未加载
评论 #31094426 未加载
AYBABTMEabout 3 years ago
I find this a very insightful application of the concept of colours to look at the problems of mixing code meant to run on slightly different and subtly incompatible runtimes, within the same code base, without calling out this distinction of &quot;colour&quot; by any particular mean of syntax, or tooling, or explicit documentation.<p>It&#x27;s a good observation that helps, at least me, shed light and give a name to this problem that many will have experienced and struggled with.
评论 #31091773 未加载
midrusabout 3 years ago
The moment you need SSR, you&#x27;d be in a better place if you were using just plain old server rendered (componetized) views, such as the ones you can do with laravel&#x27;s Blade system, and do your client side interactions with Alpine and your server interactions with unpoly&#x2F;HTMX.<p>SSR per se is not a &quot;big problem&quot;, specially if using something like Next. The problem comes when you have to mix in translations, i18n, data fetching from external sources, authentication, cookies forwarding, etc, etc, etc... in my opinion complexity grows so exponentially that I don&#x27;t see the advantage anymore.<p>I&#x27;m working on a project built with Laravel + Tailwind + Unpoly + Alpine and it is such a walk in the park to implement anything thrown at us. Although it is not &quot;cool&quot; tech, so some people around here don&#x27;t want to work on it because they only want React all the things :-s
stevebmarkabout 3 years ago
In Javascript SSR, if you need the same logic on the client and server, define an API module + interface. Make a different API bundle on the server that calls NodeJS functions, file reads, whatever, directly. Make an API bundle on the client that makes AJAX requests to your API endpoints. Now your Javascript can call the same `api.fetchWhatever()` method, and await the result, and it works on the client and server (if you need it). It&#x27;s a very nice pattern.
评论 #31090045 未加载
评论 #31091007 未加载
评论 #31092773 未加载
togaenabout 3 years ago
SSR is the dumbest thing I’ve ever heard of. Client and server are different things, treat them that way. The whole web dev community keeps tripping all over itself to make simple things wildly complicated.
评论 #31092375 未加载
canyoneroabout 3 years ago
&gt; If you&#x27;re considering using one of these frameworks, I would recommend you carefully consider if the complexity is worth it, especially for less-experienced members of your team.<p>Far too many folks seem to believe that complexity is a binary choice or that it can be avoided wholesale by choosing frameworks (or lack-thereof) to solve their problems.<p>Truth is, when you&#x27;re building software on the web, you&#x27;re gonna have gonna have to make a series of decisions on where the complexity that you&#x27;ll inevitably encounter should live.<p>We&#x27;re all simply making tradeoffs on where that complexity lives: the browser runtime, the build system, the type system, the server, the platform, their framework, your framework.
etchalonabout 3 years ago
I&#x27;m convinced SSR is only a thing because of Lighthouse scores.<p>Client-side rendering with client-agnostic REST APIs is a fantastic architecture.<p>But noooooooooo we can&#x27;t have nice things
评论 #31091247 未加载
评论 #31091006 未加载
评论 #31091656 未加载
评论 #31091142 未加载
评论 #31091528 未加载
评论 #31096169 未加载
评论 #31096396 未加载
评论 #31093234 未加载
评论 #31094114 未加载
评论 #31090753 未加载
sphabout 3 years ago
In this thread: people confusing server rendering (like your old PHP) with SSR (same Javascript codepath for client and server, i.e. Next.js)<p>One is easy, the other is the definition of leaky and crappy abstraction. This article is about the latter technology.
评论 #31091189 未加载
评论 #31091216 未加载
评论 #31092813 未加载
kodahabout 3 years ago
I already know I&#x27;m off my rocker (and my lawn with that phrasing) but I really wish the browser supported Python as a language instead of Javascript. I can pickle Python, send it to a client, and run it. Combine that with everything else Python 3 has brought to the table and I&#x27;d have a language that runs client side that I can depend on and that I love.
评论 #31092877 未加载
评论 #31090746 未加载
评论 #31090757 未加载
评论 #31091060 未加载
评论 #31090511 未加载
评论 #31090904 未加载
vmceptionabout 3 years ago
I agree with the Next.js people in that thread<p>SPA+SSR has never been easier, and my experience (as of this year) is that its as easy as static websites. Even easier in some cases with making the CSS easier while all the bundles and optimizers to make builds are hidden.<p>I think people need to rethink how they design their websites and complete concept of a viable business.<p>I get the sentiment of the absurdity off web development but its successfully been abstracted away if you keep your app and idea simple. If you’re still doing gigantic web 2.0 apps with hundreds of views, microservices everywhere and API calls going every which way, thats the problem. The stack for those is ridiculous and not even necessary anymore. You can drive [hundreds of] millions of revenue without any of that these days, without even a user account flow or state management, the market is trying to tell you something.
jdrcabout 3 years ago
whats the reason behind all this endless JS race that s been going on for years. I only had to use it once and it felt like everything was prematurely overabstracted ending in more code doing less. It made me run back to php+jquery, which is more like a car engine rather than an modern abstract art statue.<p>is it the overabundance of programmers? the fact that it makes them look busy? people liking wasting time recompiling most of the day? overengineering making people feel superior? it certainly doesnt feel healthy and makes one question whether the whole SV startup ecosystem is a cargo cult built on shaky grounds by people who are just apeing each other on everything, from design to backend.
评论 #31093527 未加载
评论 #31099034 未加载
recursivedoubtsabout 3 years ago
Hello. I&#x27;m here from 1999 and I&#x27;d like to help:<p><a href="https:&#x2F;&#x2F;htmx.org" rel="nofollow">https:&#x2F;&#x2F;htmx.org</a>
评论 #31093875 未加载
评论 #31096186 未加载
评论 #31093705 未加载
cersa8about 3 years ago
Do I live in a parallel universe where building SSR&#x2F;SPA sites with Next.js is somehow incredibly complex? I know below the abstractions there is complexity, but building SSR rendered SPA&#x27;s today with something like Next.js has never been more simple. I think web development has taken a huge leap forward where we now have stable tooling, a strongly typed language with TypeScript and top notch boilerplate free state management with MobX. To top it off you can write performant backend API&#x27;s in Node.js with again TypeScript sharing contracts (Interfaces) between backend and frontend. I for one am really happy with the current state of affairs.
评论 #31094294 未加载
评论 #31096046 未加载
locallostabout 3 years ago
The complaint in the article is technical, but my issue with the SSR + hydration approach is that it doesn&#x27;t actually work for the users. Mainly because if you need a page that is indexed by Google, there is a high chance your users will browse it and open pages in new tabs. So the approach of &quot;there is a small initial penalty, but everything is faster later&quot; no longer applies -- you get that initial hit quite often.
评论 #31096308 未加载
IceDaneabout 3 years ago
What an incredibly boring, prosaic post which is almost completely devoid of anything useful. In fact, over half of the post is just the author waxing poetic about some tangentially related things. His arguments boil down to &quot;To me, this seems like a bad idea.&quot;<p>Well, OK buddy. Then don&#x27;t do it. Meanwhile thousands of web developers have been doing it for years and it has never been easier.
评论 #31094132 未加载
galaxyLogicabout 3 years ago
What is meant by &quot;server-side rendering&quot;? Is it the same as server-side on-demand html generation?<p>If so then I think the term &quot;server-side rendering&quot; is somewhat confusing. Your server is &quot;generating HTML&quot;, not &#x27;rendering&quot; it.<p>Rendering in my view means turning code (like HTML) into visual output.. So whether the server serves always the same HTML, or regenerates it for every request, or something in between, the client&#x2F;browser still has to &quot;render&quot; that HTML into visual output.<p>True server-side rendering I would think should mean the server renders HTML into a gif or jpg which then gets shown in the browser.
评论 #31093189 未加载
e67f70028a46fbaabout 3 years ago
throw all that complicated stuff away &amp; use htmx<p>generate html the same ol’ way you always have<p>safe &amp; effective modern hypermedia
评论 #31097876 未加载
tedunangstabout 3 years ago
How can a small site like HN possibly work when SSR is so complicated?
评论 #31091080 未加载
评论 #31091095 未加载
65about 3 years ago
I&#x27;ve been testing out Alpine.js recently and find it to be very nice to use. You can have reactive state and most of the conveniences of React, but all in your HTML without a build step.<p>I work with SSR React professionally and many times I yearn for being able to just use good old fashioned templating engines and client side Javascript - no builds or anything.
chrisweeklyabout 3 years ago
See <a href="https:&#x2F;&#x2F;remix.run" rel="nofollow">https:&#x2F;&#x2F;remix.run</a> for a modern, sane, progressive approach to server-based rendering w&#x2F; as-needed hydration.
评论 #31091079 未加载
zorrabout 3 years ago
Honest question: it&#x27;s clear to me that the term SSR has been repurposed to mean this complex &quot;generate html reusing ~same code on backend&#x2F;frontend and then hydrate it&quot; thing. What do we call the classic style where the server just renders html using a template language?
评论 #31093756 未加载
Rauchgabout 3 years ago
Since the post mentions Next.js, it&#x27;s worth calling out two streams of ongoing work that solve major painpoints of SSR:<p>1. A filesystem convention (`*.server.ts`) for more cleanly separating client and server component trees<p>2. The introduction of a Web standards runtime[1] for SSR.<p>If anything, we&#x27;re entering the best generation of SSR ever. We&#x27;ll see new generations of apps shipping less JS to the client, rendering and personalizing at the Edge, closer to the user, and the infrastructure to support this will be serverless and economically every efficient.<p>[1] <a href="https:&#x2F;&#x2F;nextjs.org&#x2F;docs&#x2F;api-reference&#x2F;edge-runtime" rel="nofollow">https:&#x2F;&#x2F;nextjs.org&#x2F;docs&#x2F;api-reference&#x2F;edge-runtime</a>
评论 #31090468 未加载
saint-loupabout 3 years ago
Come on, Trisomorphic rendering or Distributed Persistent Rendering are pretty simple, basically these are just [insert joke about monoid in the category of endofunctors].<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Hydration_(web_development)#Trisomorphic_rendering" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Hydration_(web_development)#Tr...</a><p><a href="https:&#x2F;&#x2F;www.smashingmagazine.com&#x2F;2022&#x2F;04&#x2F;jamstack-rendering-patterns-evolution&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.smashingmagazine.com&#x2F;2022&#x2F;04&#x2F;jamstack-rendering-...</a>
crypticaabout 3 years ago
I figured this out several years ago when I tried to build a full-stack framework to seamlessly connect the front end and back end into a single development experience (kind of like what Meteor and Next.js turned out to be). I ended up cancelling that project, pulled out the RPC + pub&#x2F;sub internals and spun it off into a separate set of libraries which became successful on their own.<p>I&#x27;ve been saying this for years. Although code reuse is possible between server and browser and sometimes it saves a lot of time, it&#x27;s not common enough to be a default (as part of a monolithic framework) and there are security implications which make it highly desirable to differentiate between the two.<p>I do think frameworks are overused. IMO, frameworks make more sense in DevOps for infrastructure orchestration to provide resilience and scalability. For example, I think Kubernetes makes sense as a framework - Critiques of its complexity are not related to its frameworkness; there is literally no other way to do orchestration - Orchestration is the top layer which runs everything and sits above everything (including hosts and processes). Frameworks don&#x27;t make much sense in development space IMO; they&#x27;re mostly a way for companies to achieve lock-in.<p>Even on the front end, Google Polymer had already proved through their WebComponents polyfills that frameworks were not necessary to achieve reactivity on the front end. A simple, lightweight library is usually enough.
grey-areaabout 3 years ago
The original server side rendering (HTML rendered on the server by your choice of language) is simple, efficient and most sites on the internet still use it, including this one.<p>The article is talking about ‘modern’ js style server side rendering combined with client side rendering, which is of course a huge dumpster fire and encourages absurd complexity on both sides of the equation, starting with the fact the app is split in two.
评论 #31096218 未加载
pygy_about 3 years ago
This could probably be mitigated by a combination of algebraic effect handlers and session types for effects.<p>Algebraic effect handlers let you dynamically (re)define how effects are handled for a given piece of code.<p>and<p>- session types for effects, that would let one specify protocols for effects (i.e. a HTTP response handler would not be granted access to the socket, but would be allowed to use dedicated effects: `statusCode`, `header`, body` and `trailer` effects and would not be allowed to use them in a way that violates HTTP. Session types let you check that at compile time.
Animatsabout 3 years ago
This isn&#x27;t real &quot;server side rendering&quot;. This is just generating simpler HTML. Real rendering on the server would mean sending a canvas or an image or video, like &quot;cloud gaming&quot;.<p>All this complexity seldom translates into sites that do much. There are real &quot;applications in the browser&quot; that let the user do something, but those are rare, and most are toys. Most of them could have been written in Flash, anyway.
评论 #31090778 未加载
engineeringwokeabout 3 years ago
Front end complexity - Making applications isomorphic so you can re-use code on the client and server<p>Hacker News commenter: Ugh, why is this problem so over-engineered. It&#x27;s completely unnecessary<p>Back end complexity - Two hour Google article from yesterday that goes through layers of C++ and raw assembly that results in a 2-3% speed up by basically using SIMD and turning off branch prediction<p>Hacker News commenter: Wow! So cool!
gfodorabout 3 years ago
Phoenix LiveView provides a sane solution to this problem.
评论 #31091863 未加载
jasfiabout 3 years ago
Nexus DocUI is server-side defined, but client-side rendered. It doesn&#x27;t have real-time updates yet, you have to reload the page, but I&#x27;m working on a plan to implement that. Currently renders the front-end with Flutter, the back-end could theoretically be any language since it sends JSON to the front-end.<p><a href="https:&#x2F;&#x2F;nexusdev.tools" rel="nofollow">https:&#x2F;&#x2F;nexusdev.tools</a>
paxysabout 3 years ago
The common mistake teams make getting started with server-side rendering for React is thinking that your <i>entire</i> backend has to be contained in a single JavaScript bundle. Instead, use any language you want to set up your APIs and business logic. Then set up a fully independent pool of servers running Node.js whose only job is SSR. This setup skips over every problem the author mentions.
评论 #31091108 未加载
评论 #31090653 未加载
stickfigureabout 3 years ago
SSR feels like an echo of JSF (that&#x27;s JavaServer Faces for you youngins) - an exceptionally complicated way of doing simple things. IMO, SSR will follow the same arc in history - a brief period of popularity, followed by a lot of &quot;what on earth were we thinking&quot;. Client side rendering is much simpler and cleaner.
评论 #31090184 未加载
pjmlpabout 3 years ago
What is absurd is doing SSR with SPA frameworks, instead of how it has always been done.
thyroxabout 3 years ago
Laravel livewire &#x2F; Phoenix liveview and a lot of new frameworks are now focusing on bridging this gap between ssr and clientside - almost trying to make it seamless.<p>Though only time will tell, what can of worms that will open later.
评论 #31091240 未加载
ki_about 3 years ago
foreach($seo_urls as $path){ $hash = sha256($path); exec(&#x27;wget <a href="http:&#x2F;&#x2F;mywebsite.com&#x2F;$path" rel="nofollow">http:&#x2F;&#x2F;mywebsite.com&#x2F;$path</a> -o $project_root&#x2F;seo&#x2F;pages&#x2F;$hash&#x27;); }<p>-----<p>if($agent_type == &#x27;search_engine_bot&#x27;){ $path = $request-&gt;path; if(in_array($path, $seo_urls)){ $hash = sha256($path); echo file_get_contents($project_root&#x2F;seo&#x2F;pages&#x2F;$hash); exit; } }<p>----<p>Would this work?<p>Edit: well i guess not.. because wget cant render javascript.. so.. maybe with a headless browser?
exabrialabout 3 years ago
The only thing &#x27;absurdly complex&#x27; about this is the Javascript portion. Server side component based frameworks exist and work very well for this purpose.
nsonhaabout 3 years ago
article crticizes &quot;the absurd complexity of server-side rendering&quot; by starting with &quot;In the olden days, HTML was prepared by the server...&quot;
评论 #31092214 未加载
tontoabout 3 years ago
my personal worry, could be unjustified, but SSR seems to be much less secure compared to plain old client side stuff. sure, static client side is less seo friendly but...not going to compromise your servers! considering the fast moving and relatively patchy security of npm ecosystem...things like prototype pollution vulns are alerted almost weekly if not daily and you are lucky if a fix exists that you can upgrade to!
pkruminsabout 3 years ago
That’s why I still use Perl CGI scripts. They just render.
globular-toastabout 3 years ago
Ah, someone who has discovered that writing in tiny paragraphs makes for addictive reading even if the substance is minimal.
marcosdumayabout 3 years ago
Hum... You mean JS needs generic monads?<p>TypeScript supports them, doesn&#x27;t it? This shouldn&#x27;t be too hard to fix, but it&#x27;s a matter of rewriting or encapsulating all of the core language&#x27;s API.
评论 #31090069 未加载
mjflabout 3 years ago
Sorry I&#x27;m gonna just stick with server-side rendering with Django templates. All web development &#x27;advances&#x27; are a treadmill to nowhere, waste of time.
ddaalluu2about 3 years ago
You&#x27;re all clueless.
评论 #31092421 未加载