Populating the cache without opening the browser after initial deployment

Here is a thread related to that idea.

As in that thread, you can use Selenium to open your app and populate your cache. If you have some expensive operation that needs to be run nightly, that’s a simple thing to schedule from some internet-connected machine somewhere. If you don’t need it on a schedule but want it in response to a change to the source code or some other non-predictable, non-scheduled change to data, you’d have to have some function monitoring that source for changes to trigger your Selenium script to open your app and get the cache populated. I don’t know of anything slicker than that, but there is a link to a Feature Request on GitHub that you can vote on if you’d like Streamlit to have some form of this functionality natively.

1 Like