Angular 2 SpaTemplate如何删除服务器端渲染,这是什么意思是性能明智 [英] Angular 2 SpaTemplate how to remove server-side rendering and what does that mean performance wise

查看:112
本文介绍了Angular 2 SpaTemplate如何删除服务器端渲染,这是什么意思是性能明智的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个GitHub仓库,它目前有两个分支,master和clean_state(默认的Angular 2 SpaTemplate)。我正在寻找删除服务器端渲染,同时仍然保持应用程序以类似的方式工作。我正在使用Visual Studio 2017企业版,这个项目是一个Asp.Net Core 1.1项目。



我从未使用过这项技术,只理解剥离的基本知识这个模块来自于这个项目。

我的问题是完全需要从SpaTemplate中移除以除去服务器端呈现,以及通过这样做失去了哪些功能?我不仅在问什么需要改变以关闭服务器端渲染。需要删除/更改哪些文件才能将其完全从项目中删除。我想要一个GitHub仓库,我可以克隆它,包括clean_state(服务器端渲染)或no_server(完全删除的服务器端渲染)。



热模块加载仍然工作?性能差异是什么?小规模网络应用的性能差异是什么,每月100-1000次观看?什么是有或没有服务器端渲染,每分钟有数百个请求的性能是多少?



我知道给出的数字可能是或可能不是完全准确的。在给出这些统计数据时请保持理智,以及如果您提出的是疯狂的事情,请提供链接的证据。

GitHub - 链接到Repo - 请分叉并创建拉请求,如果您可以提供帮助的话。

Index.cshtml中的服务器端预渲染擦除 asp-prerender-module / code>参阅此处为确切的线条细节。热模块更换将继续运作。至于性能,你会发现你提出的流量没有明显的变化。删除它有几个缺点。

您的搜索引擎优化将会减少。 Web爬虫不会加载JavaScript,因此他们只会看到正在加载... 。预渲染也可以让最终用户感觉性能提升。该页面可以非常快速地加载,因为它已经被渲染。虽然JavaScript文件仍在下载。


I have created a GitHub repo that currently has two branches, master, and clean_state (The default Angular 2 SpaTemplate). I am looking to remove the server-side rendering while still keeping the application working in a similar way. I am working with Visual Studio 2017 Enterprise edition and this project is an Asp.Net Core 1.1 project.

I have never worked with this technology and only understand the basics of stripping this module from the project.

My question is what totally needs to be removed from the SpaTemplate to remove server-side rendering, and what features do I lose by doing this? I am not only asking what needs to change to turn off server-side rendering. What files need to be removed/changed to remove it completely from the project. I want to have a GitHub repo that I can clone that includes either a clean_state (server-side rendering) or a no_server (completely removed server-side rendering).

Will Hot Module loading still work? What are the performance differences? What are the performance differences on a small scale web app, 100-1000 views a month? What is the performance with or without server-side rendering with hundreds of requests per minute?

I understand the numbers given may or may not be totally accurate. Please be within reason when giving these statistics, as well if you're proposing something insane, provide linked evidence.

GitHub -Link to Repo - Please Fork and create pull-requests if you can help.

解决方案

To remove server side pre-rendering erase asp-prerender-module in Index.cshtml see here for the exact line details. Hot module replacement will continue to function. As for performance you'll see no noticeable changes with the amount of traffic your proposing. There are a few downsides to removing it.

Your SEO will decrease. Web crawlers don't load javascript so all they'll see is Loading.... Pre-rendering can also give the end user a perceived performance boost. The page can load very quickly because it's already been rendered. While the javascript files are still downloading.

这篇关于Angular 2 SpaTemplate如何删除服务器端渲染,这是什么意思是性能明智的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆