Update Angular SSR docs to match updated Angular 6 template
Moved from #8139
From @SteveSandersonMS on August 16, 2018 17:24
The current docs are at https://docs.microsoft.com/en-us/aspnet/core/client-side/spa/angular?view=aspnetcore-2.1&tabs=visual-studio#server-side-rendering
Discussed with @ryanbrandenburg
Copied from original issue: aspnet/Templating#677
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 32a18270-91cd-2a02-2eb8-2c8b1ed03737
- Version Independent ID: c58d57e5-a0c2-201d-f6dd-076ad5971fcb
- Content: Use the Angular project template with ASP.NET Core
- Content Source: aspnetcore/client-side/spa/angular.md
- Product: aspnet-core
- GitHub Login: @SteveSandersonMS
- Microsoft Alias: scaddie
@ryanbrandenburg in #8139 danroth27 assigned ryanbrandenburg on Aug 16, 2018
Can you give me an ETA on this?
The only way to publish an Angular web portal on the web is using Angular Universal because SEO so on my project I configured the SSR with Angular 7 using the UseSpaPrerendering configuration
When a brower asks for the first time the HTML with the first GET, the server gets between 3 to 7 seconds to render the page. I have the same issue with IIS Express and IIS 8.5 on Windows Server 2012 R2. TTFB (Time to First Byte) has to be about 200 - 300 ms.
The use case I'm investigating doesn't involve HTTP requests from the server side. Just the rendering of a simple static page from several graphical components.
It seems that the main.js file (400k in my case) is loaded and compiled for each request taking long time to respond.
Is there any way to configure a cache for the NodeJS instance or whatever to speed up this process?
I would really like to see the docs updated! Thank you @Rick-Anderson for pushing this!
Seriously? Some dev updates this but forgets to verify the documentation. Very bad.
Oh, by the way, wake up!
Now on angular 7 still outdated docs
@fabiomilheiro I agree the docs should be updated. But please be nice. Microsoft open-sourced Visual Studio to make development available to everybody. This brings a lot of maintenance with it... That's why anyone can contribute to this.
Now for your issue...
I found a repository on GitHub with a working setup: https://github.com/joshberry/dotnetcore-angular-ssr. Thanks to Josh Berry.
I tried to recreate the project with angular 8.1, .NET Core 2.2, The result of this repository with a short summary is available here: https://github.com/PieterjanDeClippel/AspNetCoreSpaPrerendering
For now I'd like to redirect you to a Medium article: https://medium.com/@pieterjandeclippel/server-side-rendering-in-asp-net-core-angular-6df7adacbdaa
Maybe I'll complete the docs about SSR, but for now you'll have to stick with this article...