I want to share a Queue data structure between all the users of my web application, without using any database. I want this data to be always available and thread safe between all the users. Is caching a good idea? I tried using System.Web.Caching by calling:
Queue<int> users= new Queue<int>();
Context.Cache.Insert("users", users, null, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration);
in my Global.axax file, but when I call the cache in my .cs files:
( (Queue<int>) Cache["users"] ).Enqueue( newUser);
I get the following error:
'System.Web.Caching.Cache' is a 'type' but is used like a 'variable'
Am I using caching correctly?
Thanks!