AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Update Angular SSR docs to match updated Angular 6 template

Open Rick-Anderson opened this issue 7 years ago • 7 comments

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.

Rick-Anderson avatar Jan 19 '19 02:01 Rick-Anderson

@ryanbrandenburg in #8139 danroth27 assigned ryanbrandenburg on Aug 16, 2018 Can you give me an ETA on this?

Rick-Anderson avatar Jan 19 '19 02:01 Rick-Anderson

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?

domfermi avatar Jan 24 '19 06:01 domfermi

I would really like to see the docs updated! Thank you @Rick-Anderson for pushing this!

dominikfoldi avatar Feb 01 '19 10:02 dominikfoldi

Seriously? Some dev updates this but forgets to verify the documentation. Very bad.

fabiomilheiro avatar Feb 07 '19 11:02 fabiomilheiro

Oh, by the way, wake up!

fabiomilheiro avatar Feb 07 '19 11:02 fabiomilheiro

Now on angular 7 still outdated docs

kilanny avatar Feb 20 '19 09:02 kilanny

@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...

PieterjanDeClippel avatar Jul 17 '19 11:07 PieterjanDeClippel