Get help from the marimo community

Updated 3 months ago

Best Practices for Caching Marimo Reports?

At a glance

The community member is running an internal reporting application and would like to speed it up significantly. The report flow involves pulling data, running calculations, building visualizations, and displaying the results. The community member is considering caching the HTML of the report once it has been calculated, and then pulling in the cached HTML if the same report is requested again. They are unsure if this is possible and are looking for examples or guidance on how to implement this. The community member finds the idea of a notebook caching itself as HTML programmatically and potentially displaying a cached version of itself to be a bit unusual, but believes the necessary tools may already be in place to do this.

We run an internal reporting application that I would like to speed up significantly. The flow of these reports are all pretty simple:

  1. Pull Data
  2. Run a bunch of calculations
  3. Build visualizations
  4. Display
What I think Marimo is probably capable of, but it isn't super clear to me yet? Is doing something like where we cache the report once it has been calculated. And if the same report is calculated again, just pull in the html that was previously cached. If it is the first time, build the full report and cache that html.

Are there any examples around this? What feels weird to me is a notebook caching itself as html programatically and potentially displaying a cached version of itself. But it seems like the tools are probably already in place to do this?
Add a reply
Sign up and join the conversation on Discord