什么是净某些数据库高速缓存选项?选项、高速缓存、数据库

2023-09-04 05:36:27 作者:箫声巷陌

我在网络上看到有很多关于缓存ASP.Net的问题,但不是很多对智能客户端应用程序缓存选项及其数据库的讨论。

I see on the web there are a lot of questions about caching ASP.Net, but not a lot of discussion on caching options for a Smart Client Application and their databases.

什么是可用于在.NET Framework的智能客户端应用程序的数据缓存选项,以及如何使用它们任何你?

What are the data caching options that are available for Smart Client Application on the .Net framework, and how are any of you using them?

修改

企业框架下面提到的想法?

Enterprise Framework was mentioned below, thoughts?

推荐答案

缓存频繁访问的数据是必需的/可取的WinForms智能客户端应用程序。从缓存中读取数据通常速度比打你的数据提供程序/ Web服务。

Caching frequently accessed data is required/desirable in Winforms Smart Client applications. Reading data from cache is often faster than hitting your data providers/web services.

下面是举例几个选项

在企业库的缓存应用程序块是一个不错的选择。 此外,的System.Web.Caching.Cache可以使用的WinForms使用,只是得到一个静态实例。

请参阅下面的例子。

使用Entlib

 using Microsoft.Practices.EnterpriseLibrary.Caching;
    //Later 
    CacheManager cache= CacheFactory.GetCacheManager(); 
    cache.Add("dataKey", "Yourdata")

使用.NET内置高速缓存 - 这将适用于您的winform应用程序也

With .NET built-in cache - This'll work for your Winform app also.

using System.Web.Caching;
using System.Web;

public sealed class CacheProvider 
{ 
    private CacheProvider(){}; 

    public static GetInstance() 
    {  
            return HttpRuntime.Cache;
    } 
}