问题
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