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
- Enabled gzip compression.
- We have set the cache to 30 days for all js & css files.
- 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.