Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is server side rendering using angular2?

I am aware that angular2 is used for server side rendering. So I would like to know more about it.

I am having following questions regarding this phenomenon.

1.What is server side rendering?

2.what problem does it solve?

3.what are its applications?

4.why server side rendering used?

5.what are the technologies that support server side rendering?

6.in angular2, what goals server side rendering helps to accomplish?

7.what are the main differences between client side & server side rendering?

8.which tools or frameworks can be used for server side rendering ?

Thanks to all in advance.

like image 243
Bhushan Gadekar Avatar asked Feb 22 '16 11:02

Bhushan Gadekar


People also ask

What is server sided rendering?

Server-side rendering (SSR) is an application's ability to convert HTML files on the server into a fully rendered HTML page for the client. The web browser submits a request for information from the server, which instantly responds by sending a fully rendered page to the client.

What is server-side rendering with example?

Server-side rendering is when content on your webpage is rendered on the server and not on your browser using JavaScript. For example, with a typical PHP or WordPress site, the page is loaded from content that is coming via HTTP, which was rendered on the server and comes as fully rendered HTML.

What is Angular server-side rendering?

Angular Interview Q & A series Server side Rendering (SSR) is a modern technique to convert a Single Page Application (SPA) running in the browser into a server based application. Usually, in SPA, the server returns a simple index. html file with the reference to the JavaScript based SPA app.

What is server-side rendering and what problems does it solve?

Server-side rendering (SSR) means that the content of your site is generated on the server, then sent to the browser. This is useful for SEO purposes, because search engines can "see" the content of your site before they send it to users.


1 Answers

Angular2 is client library and it's not used for server side rendering. There is, however, a project Angular Universal that aims to allow server to process angular code and templates.

1. In general Server Side Rendering /SSR/ refers to using a server to create content that could be consumed by the browser (or other clients).

2. With Single Page Applications /SPA/, like Angular2 apps, one of the big issues is initial load. SPAs have to load all vendor and app scripts, (maybe load content from database,) process the content, and finally render it. This can take a lot of time, so the idea is that you use SSR to create or "prerender" the initial page.

3. It's used because servers are faster then clients, so it can be big performance boost for applications. Also it's helpful with search engine robots - when they request a page of your website without SSR they would see only blank page without any content (some search engines would load and execute your scripts).

4. Angular Universal works on nodejs servers. I believe there is also a version for PHP, but it's very fresh (in alpha I think...)

5./6. see above.

like image 73
Sasxa Avatar answered Oct 02 '22 06:10

Sasxa