访问缓存到Web应用程序 [英] accessing of cache to web application
本文介绍了访问缓存到Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在c#console应用程序中为查询结果(即数据集)创建了缓存,但我想在我的Web应用程序中访问该创建的缓存如果有可能我如何在控制台应用程序的Web应用程序中访问缓存。我对缓存知之甚少,请给我详细的
Cache [TextBox1.Text] = Jobs;
Cache.Insert(TextBox1.Text,Jobs);
Cache.Insert(TextBox1.Text,Jobs, null ,DateTime.Now.AddMinutes( 10 ),Cache.NoSlidingExpiration);
string strCache = ;
string strKey;
foreach (DictionaryEntry objItem in Cache)
{
strKey = objItem.Key.ToString();
strCache = strKey + : + DateTime.Now.ToString()+ 缓存在 + : + DateTime.Now.AddMinutes( 10 );
}
解决方案
ASP.NET缓存是特定于Process / App域的,无法共享。
尝试以下
高级缓存共享缓存 [ ^ ]
SharedCache - 高性能,分布式缓存 [ ^ ]
在10分钟内安装,配置和使用Windows Server AppFabric和Velocity内存缓存 [ ^ ]
使用带有.NET / C#Client的Redis服务器进行分布式缓存 [ ^ ]
使用Memcached实现分布式缓存 [ ^ ]
Hi,
I created cache to the query results(i.e to dataset) in c# console application but i want to access the that created cache in my web application.If it is possible how can i access the cache in my web application fron console application.I dont have much knowledge in cache please give me detailed
Cache[TextBox1.Text] = Jobs;
Cache.Insert(TextBox1.Text, Jobs);
Cache.Insert(TextBox1.Text,Jobs, null, DateTime.Now.AddMinutes(10), Cache.NoSlidingExpiration);
string strCache = "";
string strKey;
foreach (DictionaryEntry objItem in Cache)
{
strKey = objItem.Key.ToString();
strCache = strKey + " : " + DateTime.Now.ToString() + "Cache Expires at" + ":" + DateTime.Now.AddMinutes(10);
}
解决方案
ASP.NET cache is Process/App domain specific, it can't be shared.
Try below
Advance Caching with Shared Cache[^]
SharedCache - high-performance, distributed caching[^]
Installing, Configuring and Using Windows Server AppFabric and the "Velocity" Memory Cache in 10 minutes[^]
Distributed Caching using Redis Server with .NET/C# Client[^]
Implementing Distributed Caching using Memcached[^]
这篇关于访问缓存到Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文