Streamlit reruns all 30 seconds

Thank you for the quick reply!

Before even reading your response I actually somehow found out that it could have something to do with the configuration for websocket applications.

Maybe this will help others also, but on top of the timeout, I actually updated the backed to use a generated cookie to identify the user session and not reload the page in case it is coming from the same user (resulting in not reloading the app).

This tutorial was useful: https://medium.com/k8scaleio/running-websocket-app-on-kubernetes-2e13eabb4c4f

But I actually went with

    spec:
      sessionAffinity:
        affinityType: "GENERATED_COOKIE"
      timeoutSec: 300
      connectionDraining:
        drainingTimeoutSec: 600

to generate a cookie instead of relying on the IP for user identification (in case multiple people try to access the app through a proxy)

For different types of backend affinity also see: https://cloud.google.com/load-balancing/docs/backend-service#session_affinity

Edit:
Apparently I was a little too confident here. After the timeout the reloading happens anyways, so the affinity doesn’t seem to change anything. So I just went with a higher timeout for now as suggested before, which kind of fixes the issue.