The Wayback Machine - https://web.archive.org/web/20200901044407/https://github.com/angular-fullstack/generator-angular-fullstack/issues/2661
Skip to content
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

Question about first page load speed. #2661

Open
rollermy opened this issue Oct 28, 2017 · 5 comments
Open

Question about first page load speed. #2661

rollermy opened this issue Oct 28, 2017 · 5 comments

Comments

@rollermy
Copy link

@rollermy rollermy commented Oct 28, 2017

  • I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.
Item Version
generator-angular-fullstack 4.2.2
Node 8.1.2
npm 5.4.2
Operating System Ubuntu 17.10
Item Answer
Transpiler Babel
Markup HTML
CSS SCSS
Router ui-router
Client Tests Mocha
DB MongoDB
Auth Y

How can i improve first page load speed?
The biggest file is the app.js at about 2.5mb. I have this gziped down to ~500k which is still pretty big. On a normal 3G connection it still taken 4-5 seconds to load the first time.
Is this to be expected? Or am i missing something?
Are there some tools or configurations that will work well with angular-fullstack that can help speed this up?
Thanks!

@Awk34
Copy link
Member

@Awk34 Awk34 commented Oct 30, 2017

I'm sure there's a bunch of things that could be done to improve first-load, but it hasn't been at the top of my priority list. I'd be happy to look over any PRs if you find some good solutions.

@albert-92
Copy link
Contributor

@albert-92 albert-92 commented Oct 30, 2017

Did you run it in development environment? My app.js is also 2-3MB in dev env.
However in production env it's usually < 1MB (probably even smaller after gziped), since all the comments and debug stuff are thrown out and it also gets minified.

@nigel-dewar
Copy link

@nigel-dewar nigel-dewar commented Nov 29, 2017

Is it possible to use Server-Side pre-rendering with to solve this?

I've heard it has been pretty successful with react and angular2 projects to solve the first time page load time issue

AHHHH Never mind, the CANARY branch has server side rendering....

@rollermy
Copy link
Author

@rollermy rollermy commented Feb 24, 2018

I look forward to using the trying out the angular 4 generator too.
A new install does have smaller files. But the app + vendor + polyfill is still ~800kb before adding anything and without gzip. I guess it could be smaller without bootstrap.

@albert-92
Copy link
Contributor

@albert-92 albert-92 commented Mar 29, 2018

I found something that might help you.

Check your webpack.make.js and search for

new webpack.optimize.UglifyJsPlugin({
    mangle: true,
    ...
})

If the mangle option is set to false, set it to true. This should reduce the app.js file size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.