The speed of file preview is very slow

I have started a document server(Version: 8.3.3.18) in the local Docker. Previewing a remote docx file of 50-60 megabytes takes more than 15 seconds. Through the console, it is found that the WebSocket request alone occupies ten seconds, while previewing the same file through the test example only takes 3 seconds. May I ask what measures can be taken for optimization?


Thank you in advance.

Hello @ajianxian,
Please clarify - are you using any proxy in front of the Document Server?

I created the preview project using the default template of Vue 3, and no proxy configuration was enabled.
When I directly accessed the remote file address, the file download speed was very fast, only taking 3 seconds, which proves that it should not be a network problem.
I tried to optimize the speed of the WebSocket interface by adjusting the configuration, so I modified the code of the document server’s default.json as shown in the figure, but it didn’t take effect either. I wonder if there is no such API configuration. Thank you for your reply.

Please update to the recent 9.0 version first and check there. If the issue stays, test file opening with simple html, provide the link to Document Server there, check if the problem still reproduces.
Also, activate debug level of logging (/etc/onlyoffice/documentserver/log4js/production.json - change “level”: “WARN” to “DEBUG”), reproduce the issue and share the logs (/var/log/onlyoffice/documentserver - inside the container) after updating

Thank you for your reply! After troubleshooting, it was found that the problem was in my code. Considering that different files need to be opened with different key values, I used a timestamp to identify the document when generating the document key value; after deleting this part of the code, the document preview speed has significantly improved. Moreover, when previewing the file for the second time, caching has been enabled, which is much faster than the first preview, taking only a few seconds to complete.

Thank you very much to the team for bringing such excellent works!

2 Likes

Thank you for sharing! Glad to know that the issue has been resolved, the thread will be closed.