Angular Universal TTFB is very slow

試著忘記壹切 提交于 2020-06-28 04:45:24

问题


When I run my application with angular universal, I am seeing huge difference in TTFB. ssr is taking more time than normal angular command. How to improve TTFB with angular universal server side rendering?

npm run serve:ssr

Performance tab:

ng serve

Looked into many sites but didn't found any relevant solution on internet till yet.


回答1:


It seems that you have a setTimeout or an http call that takes too much time to finish and angular universal does not serve the webpage until all the calls are finished.

I recommend you that if the timeout or http call is not essential to render the webpage, avoid the call on the server side.



来源:https://stackoverflow.com/questions/57367354/angular-universal-ttfb-is-very-slow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!