Load Time and JavaScript

how do I solve this in streamlit where I don’t know how their js works or how do I make them load at the end of the file?

Hi @Kanjani_Kabir, welcome to the Streamlit community!

Are you actually experiencing an issue with Streamlit or did you see this in the developer console and it worried you?

In general, to make a package like Streamlit work, there has to be a lot of boilerplate JS code “just in case” new widgets show up. Meaning, the front-end code has to account for all of the widgets that might get passed from the Python backend.

The analysis tools in the browser is just highlighting that if the page always stayed the same there is JS that could be removed. But since the point of Streamlit is to make writing apps from Python possible, there really isn’t a way to remove the JS that makes all that possible.


1 Like

Fair Point but is there any way they can load at the end of the file, so there is something displayed on the screen because otherwise it really is annoying to see it taking such a long time to display on the screen?

How would Streamlit render content without having the JavaScript? It feels like a chicken-and-egg scenario.

Yeah, that makes sense. But is there a way you can help me with it? If you want to look at the project, you can look at guesselo.herokuapp.com.I really want to make it faster.

The slowness I see from your app is pre-loading, meaning I think that the Heroku free tier has to wake up before the app is shown, which takes quite a while. Once the Streamlit portion actually started loading, it was quite fast.

You might try using Streamlit Cloud, which has a different method of keeping apps showing. If the latency still occurs, then you can further dig into the Python code and see how things might work better.