3 ms·
>Server Side Rendering: Uh, the whole idea behind stuff like angular is decoupled frontends from your server. Build a REST API and point angular at it; no need
by elros 11y ago
>Server Side Rendering: Uh, the whole idea behind stuff like angular is decoupled frontends from your server. Build a REST API and point angular at it; no need to ship layout code with services.
This is not a solution because the lack of content from the perspective of UAs that don't process JS (such as some web crawlers) decreases search ranking.
The alternative solution for the architecture you propose (0 rendering on the server) is to add a prerendering server between the Internet and your system.
With JS frameworks that do not depend on the DOM, one can have isomorphic JS that runs in both the browser and node. This means the same code can run on the server, for the first request, and after the rendered code is sent down the pipe further requests use the API.
Sending acontent-less HTML with proceeds to fetch something from some API is a non-answer for websites whose search ranking is relevant.
If I had to chose between isomorphic JavaScript + server-side prerendering OR having an extra layer between my frontend server and the Internet, I rather the former – assuming there are no other language/technology requirements.
- fein 11y agoSo code your public facing pages with static html and reserve angular for the app? The public pages I build for my apps are all static html with some JS for flashy crap that people ask for. Search engines don't need to care about the app itself, just the front page, about page, contact, etc, of the biz. Unless you're talking about a CMS built in Angular, which can get sketchy. Google's web crawler parses JS now anyway, so it shouldn't be a huge problem.
- elros 11y agoWell, you're assuming the content does not live inside the app. In my situation, and in many others, it does.