I am using R to deploy an app over the web, but the URL from which my app takes data is where my app takes time. Is it possible to cache that data? I tried to install the pa
This article from Rstudio is quite exhaustive and walks you through different ways to achieve that (i.e diskcache, the storr package or a Redis instance).
The main logic revolves around rendering a cached element and setting up the logic for cache invalidation:
function(input, output) {
renderCachedPlot(
{
# Code for a beautiful plot
},
# A change in the input or the dataframe will invalidate the cache
cacheKeyExpr = list({ input$n, df() })
)
}