Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

Opening the localhost:3000 page at the first time is very slow

Open bianyueyan opened this issue 5 years ago • 4 comments

I am running the latest version.

I deployed the dcm3chee-arc-light at my local computer, then connected with the OHIF viewer. When I open the localhost:3000 page at the first time, it is very slow. I checked the network information with dev tool, I found the reason is that there is the file "app.js" with the size of 46.8 MB. It is too large. Please give a solution for how to compress this file making faster.

bianyueyan avatar Mar 08 '21 17:03 bianyueyan

I face similar problem, but in my case it is not first time load, it takes a few minutes to fully load the page.

dfsRony avatar Mar 08 '21 19:03 dfsRony

OHIF uses webpack to bundle all the libraries together. If you'd rather have several smaller files to download instead of one large one, you can use the SplitChunksPlugin.

There are lots of articles on Google showing you how to do it. Here is one article that advocate on one chunk per library to take advantage of HTTP/2 multiplexing. https://medium.com/hackernoon/the-100-correct-way-to-split-your-chunks-with-webpack-f8a9df5b7758

PoyangLiu avatar Mar 09 '21 01:03 PoyangLiu

OHIF uses webpack to bundle all the libraries together. If you'd rather have several smaller files to download instead of one large one, you can use the SplitChunksPlugin.

There are lots of articles on Google showing you how to do it. Here is one article that advocate on one chunk per library to take advantage of HTTP/2 multiplexing. https://medium.com/hackernoon/the-100-correct-way-to-split-your-chunks-with-webpack-f8a9df5b7758

Thanks for your answer. I found the commented parameter "compress: true" in the file "viewer/.webpack/webpack.pwa.js". I uncomment this parameter, then it works.

bianyueyan avatar Mar 09 '21 13:03 bianyueyan

Please review the latest code in the master branch. I am confident that this issue has been resolved. If it persists, kindly reopen the issue with updated details.

Try viewer-dev.ohif.org instead of viewer.ohif.org Our viewer.ohif.org is deployed from release branch while viewer-dev.ohif.org is our master branch Read more about branch explanations here https://docs.ohif.org/development/getting-started#developing

sedghi avatar Oct 13 '23 02:10 sedghi