One question regarding the states: when do I get a new State allocated? Is it with every new tab? It's definitely not per-browser-session: if I open a new tab I seem to get a new state, while undoing a closed tab seems to recover its state with it though.
I am not very familiar with how modern Python wsgi servers manage states, but in Java e.g. states can be cached in the heap of the one and same JVM --- can one say that the need to use an external state store like Redis is a direct result of the underlying web server having to launch multiple Python processes in order to scale up for greater loads?
Does that place some restrictions on what can be done with the state? e.g. does it need to be pickleable and relatively small since it needs to be loaded from redis on every event?
We use the `cloudpickle` library which supports most data types. We found the state size doesn't impact performance too much - our main website's state is quite large but the Redis loads stay fast.
One question regarding the states: when do I get a new State allocated? Is it with every new tab? It's definitely not per-browser-session: if I open a new tab I seem to get a new state, while undoing a closed tab seems to recover its state with it though.
Also are old states gc'ed?