I have deployed a shinyapp which uses a .Rdata file of ~700Mb.
The Rdata file is loaded in server-inputdata.R
file and the server.R
file looks like as shown below:
options(shiny.maxRequestSize = 100*1024^2)
source("helpers.R")
print(sessionInfo())
shinyServer(function(input, output,session) {
source("server-inputdata.R",local = TRUE)
source("server2.R",local = TRUE)
source("server3.R",local = TRUE)
})
Here, server2.R
and server3.R
has visualization code which uses the data loaded from .Rdata file in server-inputdata.R
Whenever the app is loaded, the Rdata file is getting loaded for each user. Could someone help how to load the data only once and provide immediate access to the users. Checked a similar thread here https://stackguides.com/questions/31557428/r-load-only-once-a-rdata-in-a-deployed-shinyapp
which did not help to solve my issue.
Here is the code in server-inputdata.R
inputDataReactive <- reactive({
load('04.Rdata')
return(list("data"=data_results,
"data_results_table"=data_results_table))
print("uploaded data")
})