-
Notifications
You must be signed in to change notification settings - Fork 429
feat(preboot): add preboot functionality & fix aspnetcore-engine #401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
MaklaCof
commented
Sep 6, 2017
Am I wrong or preboot is something used only with SSR. I am not sure if I should merge this commit with my project, which does not use SSR.
It's only with SSR yes, you wouldn't need it. It's to fill the gap between SSR and CSR in terms of user actions/input.
Has anyone noticed performance degradation in server response times when implementing these changes?
In my case up from a norm of 414 ms to 4.3 s. It's back to normal again after commenting out the changes and republishing.
Wow I haven't noticed that, but that's quite strange that it would slow it down! It's just a little script in the HTML. Hmm I'll have to look into this one! @peterdobson let me know if you discover anything else with this!
Sorry @MarkPieszak , I've concluded that something else is causing my server performance degradation. I'd incorrectly assumed it was related to the preboot changes because that's all I changed before seeing the response times shoot up and it went down again when I commented out the changes. The performance issue has just happened again (without the preboot stuff) so there must be something random going on that's causing it. Apologies for the false alarm.
Oh good I brought it up with everyone and they hadn't seen it, didn't have a chance to look into it yet so no harm no follow 👍
Take care
@peterdobson I am also facing random increase in response time. On a live app its taking about 1-3 sec for server rendered pages. @MarkPieszak can you please share some tips and best practices on optimization of initial response time.
It seems that Angular expects to construct a new app platform instance to serve each request. Which means that the bootstrap process is performed for each server rendered request. Is it possible to have some sort of cache so that the bootstrap is performed only for the first request.
I also come across the below react-ssr probably addressing same issue:
https://github.com/walmartlabs/react-ssr-optimization
Found something related to angular:
When a request is made (in development) it looks to make sure that it is AoT'd, if not it compiles it, caches that, and then starts the serialization process. Further hits will use the cached AoT verison, this might be the slow time you're seeing occassionally.
Remember that the Development version doesn't matter much since there's a lot going on there that won't be in Prod.
As for render times, make sure your API responses aren't taking too long. It waits for everything before stabilizing and rendering. So if you have an API call that takes 3 seconds, it will slow down your rendering that much.
If you have a setTimeout for 1 second, it'll wait for that before rendering as well.
Make sure you look into all of these things that might be slowing down SSR performance.
🎁 🎁
Added functionality to make sure (the temporary) aspnetcore-engine grabs scripts from the head, since preboot for example puts its code there to make its magic work.
Now we have preboot working as it should 👍