Persisting state in the browser #662
|
When running a stateful web app (incrementing counter) I noticed that if my server hot-reloads I lose all state in my browser. Is it possible to shift some of the state to the frontend to allow for load balanced servers where you can't always be on the same server each request? Or does idom rely on the web sockets for state transfer even in production mode? |
Answered by
Archmonger
Feb 9, 2022
Replies: 1 comment 2 replies
|
In order for anything to be persistent, you'll need some sort of persistent storage, such as a database. If your web framework of choice (FastAPI, Flask, etc) does not have integrated database capabilities, you might want to pip install an ORM such as SQLAlchemy. |
2 replies
Answer selected by
tclasen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In order for anything to be persistent, you'll need some sort of persistent storage, such as a database.
If your web framework of choice (FastAPI, Flask, etc) does not have integrated database capabilities, you might want to pip install an ORM such as SQLAlchemy.