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
Lazy js loading overview #36728
Comments
Maybe unrelated to this effort, but the viewer and unsupported browser scripts are loaded synchronously and are super slow. Do you want me to look into this @juliushaertl? |
Feel free to jump in on those topics, I don't really have much time to focus on this currently. Any contributions are welcome :) |
Just wanting to point out that enabling gzip content-encoding in the webserver seems to make a huge difference in terms of transferred js file sizes. core-common.js is then for example reduced from 13.3 MB to 3.5 MB. Dashboard for example loads thus in almost half the time: 7.5s vs 12.5s before in my testing without browser cache (not the fastest network connection here). Maybe we should suggest this in the docs at least for js files or does this come with known downsides? |
Brotli seems to look even better: reduces core-common.js down to 2.0 MB. I will enable this in AIO by default with nextcloud/all-in-one#2576 for js files. |
btw, it looks like for some response content is by default gzip used. Is there a reason this could not be applied by Nextcloud by default for js assets? |
Agree, serving JS without gzip is a disaster. I'd be a bit careful with brotli though. You can't compress brotli on the fly; that'll be too slow. The use-case for brotli is serving pre-compressed artifacats, so need to make sure that is the case. |
We can't do anything about viewer here since it has some side effects (hooks), but lazy loading the components themselves seems to do the trick for performance. nextcloud/viewer#1675 |
I just tested this with the login page (time with new load in new private window until it shows login form) and these are the results:
So even on the fly Brotli seems to be the fastest :) |
The text was updated successfully, but these errors were encountered: