There are quite a few articles on improving performance of Shiny backend, but I could not find any that address bottlenecks in network.
My app loads quite a few js files and the inital load time is quite long (~20 seconds on average), although the total size is just a couple of megabytes. Profiling app with profvis confirmed that backend takes about 2 seconds to execute (it also runs fast on a local machine), so the bottleneck is indeed in network.
I have noticed that dependencies are loaded sequentially, there's no caching and everything is reloaded every time. On backend most of the dependencies are using htmltools::htmlDependency to load.
Is there any way to optimize that? Could anyone share their best practices to address this issue?