I'm testing memoise to cache a big dataframe in a R shiny application. It works totally fine on my local windows machine but as soon as I deploy the code on the Linux server, somehow it seems memoise doesn't do anything and every time I try to call the memoise function it takes it forever to load. Hence my question: is there a specific setting I need to change in order to efficiently run on a linux server? Sample code (the real code loads a dataframe from a database and massage the data):
ui <- dashboardPage( # https://rstudio.github.io/shinydashboard/structure.html
title = "Dashboard",
dashboardHeader(title = "Angelo's Board"),
dashboardSidebar( # inside here everything that is displayed on the left hand side
includeCSS("www/styles.css"),
sidebarMenu(
menuItem('menu 1', tabName = "menu1", icon = icon("th"),
menuItem('Data 1', tabName = 'tab_data1'))
)),
dashboardBody(
tabItems(
tabItem(tabName = 'tab_data1')),
h3("Page with big table"),
fluidRow(dataTableOutput("main_table"))
))
server <- function(input, output, session) {
func_create_df <- function(){
df <- data.frame(names = c("Mark","George","Mary"), age = c(30,40,35))
df
}
func_create_df_mem <- memoise(func_create_df, ~timeout(1))
output$main_tabl <- renderDataTable({
df <- func_create_df_mem()
})
}
cat("\nLaunching 'shinyApp' ....")
shinyApp(ui, server)
As a side, less important question, it seems the timeout feature described here (https://blog.rstudio.com/2016/02/02/memoise-1-0-0/) doesn't do anything as well.