11.8 Storing a richer state
URL bookmarking is simple and works everywhere you may want to deploy. Your Shiny app however, could become very long if you have a large number of inputs. If this is the case, it may be better to store your state on the server side.
Shiny saves the state of your app in an .rds
file on the server and generates a shorter and easier URL. To do this, you can simply change the enableBookmarking
argument to be “server” instead of “url”
# shinyApp(ui, server, enableBookmarking = "url")
shinyApp(ui, server, enableBookmarking = "server")
This generates URLs like this: http://127.0.0.1:4087/?_state_id_=0d645f1b28f05c97
The parameter in this instance is the state_id
which corresponds to a directory in your working directory - shiny_bookmarks/0d645f1b28f05c97