Professional Documents
Culture Documents
nsforms data into meaningful class instances and business processes. For example
, in Community Server, this is where you populate a Forums or Threads collection
, and apply business rules such as permissions; most importantly it is where the
Caching logic is performed.
Tip 4 ASP.NET Cache API
One of the very first things you should do before writing a line of application
code is architect the application tier to maximize and exploit the ASP.NET Cache
feature.
If your components are running within an ASP.NET application, you simply need to
include a reference to System.Web.dll in your application project. When you nee
d access to the Cache, use the HttpRuntime.Cache property (the same object is al
so accessible through Page.Cache and HttpContext.Cache).
There are several rules for caching data. First, if data can be used more than o
nce it's a good candidate for caching. Second, if data is general rather than sp
ecific to a given request or user, it's a great candidate for the cache. If the
data is user- or request-specific, but is long lived, it can still be cached, bu
t may not be used as frequently. Third, an often overlooked rule is that sometim
es you can cache too much. Generally on an x86 machine,