I'm looking for an efficient way to store some user-level data that do not need to be persistent.
For example, I would like to show user a different error message when user encounters the same error more than once. Right now I generate a user-unique key and then add it to the c开发者_如何学Goache system.
I first thought to store it in the user session, but it is stored in database and I don't need it to be stored there. It's ok if this data will be lost on server restart/shutdown.
May be there is a better solution for such cases?
The session is the right place. If you don't want to use the database, then don't use a database session backend.
精彩评论