假设在 C#/ASP.net 环境中有以下代码块:
// Read from the cache
object value = Cache["key"];
// Add a new item to the cache
Cache["key"] = value;
Cache.Insert(key, value);
Cache.Insert(key, value, CacheDependency);
Cache.Insert(key, value, CacheDependency, DateTime, TimeSpan);
现在,假设一个 IE9 浏览器打开了 3 个不同的选项卡。
该缓存项是否可用于每个选项卡?任何 future 打开的标签?或者它是否仅适用于具有创建它的网页的选项卡?
最佳答案
首先,Cache
是服务器端,其次,它在该 Web 服务器的所有用户之间共享,因此,与您拥有的用户一样多,他们将共享相同的 Cache
不考虑浏览器的对象。
关于c# - 当您读取/写入缓存时,该信息处于什么级别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30266322/