Does the Cache reboot?

If you have multiple users on your website on the same page and they run queries (searches) and the results are stored in data format. Will the user's last lookup overwrite the app cache if you store it in the cache? Is this the reason for using a session?

0


source to share


3 answers


It depends on how you store the information in the cache. If the information is the result of different requests, then the cache must store this value in different keys.



+2


source


If you have saved them under the same key, be sure. If you made a key user or session, you could avoid a collision.



+2


source


It should be noted that cache and session differ in different ways than just scope.

Items in the cache are usually of a type that can be recreated if needed, and by default items can come out of the cache in no particular order.

On the other hand, session elements remain in the session until they are removed by code. Also, a session cannot be local storage in a process, it can be on another process, a server, or even a database.

+1


source







All Articles