Is it possible to reduce the number of js and css files? (need to optimize for speed)

We are using the latest version of NextCloud(23) and the file app is loading in about 7 seconds.
We want to optimise the JS & CSS files so that it can load within 2 seconds and give better user experience.

We have done the following

  1. Enabled gzip compression.
  2. We have set the cache to 30 days for all js & css files.
  3. Already using http2 & php fpm.

When the user log in, the file app loads around 44 js files and many other css files, including not relavant to the files app. Its loading rainloop js, deck js, onlyoffice js and all.

Can we load only relavant app’s js on each app opens.

Currently on files app its loading all below JS files.

/core/js/dist/main.js
/core/js/dist/files_fileinfo.js
/core/js/dist/files_client.js
/index.php/js/core/merged-template-prepend.js
/apps/accessibility/js/accessibilityoca.js
/apps/files_sharing/js/dist/main.js
/apps/files_videoplayer/js/files_videoplayer-main.js
/apps/rainloop/js/rainloop.js
/index.php/js/files/merged-index.js
/apps/files/js/dist/main.js
/apps/deck/js/deck-collections.js
/apps/spreed/js/talk-collections.js
/apps/files_sharing/js/dist/collaboration.js
/core/js/dist/systemtags.js
/apps/systemtags/js/systemtags.js
/apps/comments/js/comments.js
/apps/contacts/js/contacts-files-action.js
/apps/federatedfilesharing/js/external.js
/apps/files_versions/js/files_versions.js
/apps/onlyoffice/js/desktop.js
/apps/onlyoffice/js/main.js
/apps/onlyoffice/js/template.js
/apps/recommendations/js/main.js
/apps/text/js/text-files.js
/apps/files_sharing/js/dist/files_sharing.js
/apps/files_sharing/js/dist/additionalScripts.js
/apps/files/js/dist/sidebar.js
/apps/files/js/fileinfomodel.js
/index.php/js/activity/activity-sidebar.js
/apps/comments/js/comments-app.js
/apps/comments/js/comments-tab.js
/apps/spreed/js/talk-files-sidebar.js
/apps/files_sharing/js/dist/files_sharing_tab.js
/apps/files_pdfviewer/js/files_pdfviewer-main.js
/apps/onlyoffice/js/viewer.js
/apps/onlyoffice/js/listener.js
/apps/text/js/text-viewer.js
/apps/viewer/js/viewer-main.js
/apps/files_trashbin/js/files_trashbin.js
/apps/files_rightclick/js/script.js
/apps/files_rightclick/js/files.js
/apps/notifications/js/notifications-main.js
/apps/theming/js/theming.js
/core/js/dist/unified-search.js

Basically, Our objective is to load the page within 2 seconds.

I think this are mostly small files. Can you post the size of the files sorted by file size?

Also you can perhaps create a 60 minutes free account at https://try.nextcloud.com . The password is “demo” on the servers https://demo1.nextcloud.com or https://demo2.nextcloud.com. Can you post differences in performance and loaded files?

Hello,

In my Office testing
When I tried the try.nextcloud.com, It takes about 20 seconds to load.
Our installation & optimized, takes around 7 to 8 seconds to load.

In Datacenter testing
try.nextcloud.com => takes around 15 seconds to load.
Our installation & optimized, takes around 5-6 seconds to load.

though, those files are small, but the number of request for css & js files are more, it makes it slow.
Overall, IMHO, user do not like if the page is loading more than 2 to 3 seconds. To give better user experience, IMHO nextcloud should load within 3 seconds.


js-files