Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As applications grow it is quite normal to leverage caching as a way to gain scalability and keep consistent server response times. Caching works by storing data in memory to drastically decrease access times. To get started I would look at ASP.NET caching. </p> <p>There are 3 types of general Caching techniques in ASP.NET web apps:</p> <ul> <li>Page Output Caching(Page Level)</li> <li>Page Partial-Page Output(Specific Elements of the page)</li> <li>Programmatic or Data Caching</li> </ul> <p><strong>Output Caching</strong></p> <p>Page level output caching caches the html of a page so that each time ASP.NET page requested it checks the output cache first. You can vary these requests by input parameters(<a href="http://msdn.microsoft.com/en-us/library/system.web.ui.outputcacheparameters.varybyparam.aspx" rel="nofollow noreferrer">VaryByParam</a>) so the the page will only be cached for users where ID=1 if a requests come in where ID=2 asp.net cache is smart enough to know it needs to re-render the page. </p> <p><strong>Partial-Page Caching</strong></p> <p>a lot of times it wont make sense to cache the entire page in these circumstances you can use partial Page caching. This is usually used with user controls and is set the same way as page level only adding the OutputCache declarative inside the usercontrol. </p> <p><strong>Data Caching</strong></p> <p>You can store objects or values that are commonly used throughout the application. It can be as easy to as:</p> <pre><code>Cache["myobject"] = person; </code></pre> <p><strong>Enterprise Level Caching</strong></p> <p>It is worth mention that there are many Enterprise level caching architectures that have come about to leverage the effectiveness caching. <a href="http://sourceforge.net/projects/memcacheddotnet/" rel="nofollow noreferrer">Memcache</a> for .net and <a href="http://msdn.microsoft.com/en-gb/windowsserver/ee695849.aspx" rel="nofollow noreferrer">Velocity(now App Fabric)</a> are a couple. </p> <p><strong>In General</strong> </p> <p>You can't really make blanket statements on what you should and shouldn't cache because every application is different. However, you can make a few generalizations that hold true <strong>MOST</strong> of time. Static elements like images and content are OK to cache. Even a dynamic page that is getting hammered is worth caching for 5-10 seconds, it will make a world of difference to your web server.</p> <p><a href="http://msdn.microsoft.com/en-us/kb/kb00323290.aspx" rel="nofollow noreferrer">Caching overview</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload