0

I've have built a rather complex R Shiny application, which runs on my Shiny Server (Ubuntu 20.04). I'm using a global.R file to load various datasets and functions.

After a restart of the shiny-server or any new changes to the ui.R or server.R files, the Shiny Server seems to take between 30-40 seconds to launch the app for the first time. After this initial launch, all data seems to be cached, thus the loading time during further sessions reduces to a few seconds.

Is there any way to pre-load all data and functions even before the initial launch of the shiny app? I thought using a global.R file and maybe executing it before the initial launch would help, but this does not seem to work. Any help/comments/thoughts are greatly appreciated!

  • 2
    Perhaps you would like to consider to keep app working all the time? Then (if I'm not wrong, I didn't use it) data should be loaded only once, first time the app is launched by any user: [How can I prevent my Shiny App from disconnecting in a open-source shiny-server?](https://stackoverflow.com/questions/54417101/how-can-i-prevent-my-shiny-app-from-disconnecting-in-a-open-source-shiny-server) – gss Dec 02 '21 at 12:19
  • I am not sure it is needed to restart your App on updating your ui.R and or server.R as they are loaded upon each browser refresh in contrast to global.R that only get loaded once upon a (re)start of the App. – Merijn van Tilborg Dec 02 '21 at 12:26

0 Answers0