[Resolved] Pre-loading/caching large objects

My Shiny app reads large data frames from RDS files dynamically and it takes enough time to make users feel annoyed in the long run. I'm wondering if there is a way to pre-load those large data frames once before running the app for the first time and make them available across all app instances for all future app runs (let's say until the Shiny server restart). The large data frames are static and never get changed by the app.
As far as I understand, reading those data frames and storing them in memory in global.R would not be an ideal solution as it would then happen every time app is run and each user will have to wait until the reading completes before they can continue using the app.
Is there a way to store the large objects in some super global server-wide environment so that once done, those objects become available in each future app instance please?

Resolved by replacing the heavy bits into global.R - only executed once after app has been deployed and run for the first time.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.