I have a shiny app on RStudio's free shiny server that uses a fair number of libraries which results in a slow calculation time. The time for the UI to load is acceptable. I placed the libraries in a global.R file so that they can be shared across users.
# All libraries are in global.R for faster start times
source("<path to global.R>", local = T)
ui <- fluidPage(
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
With this setup, the first person to access the app from a browser has a longish wait (~10s) for their first calculation. Subsequent calculations by this user and visits by different users are fast. If everyone closes their browser, the next user to come along will wait ~10 long seconds for the app to calculate.
Is there a way to configure things so that even the first user has a short wait time because the libraries are already in memory?
I think the result I'm looking for would be as if I had a browser tab open all the time pointing to my public shiny app and I hit reload and calculate once (to add the libraries that are not added when the ui starts up). Whenever the app times out and turns grey I reload and calculate again.