<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4034578776695852095</id><updated>2011-12-14T19:00:53.722-08:00</updated><title type='text'>Dot Net codes</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnet-codes.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4034578776695852095/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dotnet-codes.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Suman Biswas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://bp0.blogger.com/_hrre9HnkHlU/SElk5gZvEQI/AAAAAAAAACk/8lg9xnjxdRk/S220/suman.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4034578776695852095.post-3507280516515663697</id><published>2008-04-09T05:28:00.001-07:00</published><updated>2009-02-27T03:54:13.961-08:00</updated><title type='text'>OOP in .Net</title><content type='html'>I will not bore you with evangelism about "why caching is so great"; it is assumed you already understand, at least in theory, what caching can buy you as an ASP.NET developer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;At a minimum a developer wants to be able to cache some (or possibly all) of the pages in her ASP.NET Application. The simplest way to achieve this is to add the @ OutputCache directive to the top of the .aspx file of each page: &lt;/p&gt;&lt;p class="style1" align="justify"&gt;&lt;%@ OutputCache Duration="5" VaryByParam="none" %&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="style1" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="style1" align="justify"&gt;&lt;!-- Google Add --&gt;&lt;br /&gt;         &lt;br /&gt;           &lt;/p&gt;&lt;div class="'adsense'" style=""&gt;&lt;br /&gt;       &lt;script type="text/javascript"&gt;&lt;!--         google_ad_client="pub-5848776899597517";         google_ad_host="pub-1556223355139109";         google_ad_width=468;         google_ad_height=15;         google_ad_format="468x15_0ads_al_s";         google_color_border="336699";         google_color_bg="FFFFFF";         google_color_link="0000FF";         google_color_url="008000";         google_color_text="000000";         //--&gt;&lt;/script&gt;&lt;br /&gt;       &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;br /&gt;        &lt;/script&gt;&lt;br /&gt;       &lt;/div&gt;&lt;br /&gt;          &lt;br /&gt;&lt;br /&gt;           &lt;!-- End Google Add --&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="style2" align="justify"&gt;Now, that was easy, wasn't it? But - exactly what does it do? You are specifying how long the page is to be retained in the Cache with the Duration attribute, in seconds. In the above example, this page will be rendered on the first request for it, and stored in Cache. For five seconds, all subsequent requests for this page will be served from the Cache, which is &lt;strong&gt;hugely faster&lt;/strong&gt; than having to go through the entire Page lifecycle, possibly combined with database access, re-render and finally serve the page HTML to the client. After five seconds, the page will again be rendered (and once again, stored in the Cache). &lt;/p&gt;&lt;p class="style2" align="justify"&gt;Do you want to perform a simple test that will convince you to become a "Cache Convert"? Fire up Application Center Test or Homer (Web Stress Tool) and throw 100 simultaneous threads at a sample page that gets a DataSet out of your favorite database and populates a DataGrid with a DataTable from it. Run this test for one minute, and note the total number of successful requests for the duration of the test. Now, modify the page by putting the above OutputCache directive at the top of the .aspx file. Then run the test again, and compare. It is as objective as gravity -- &lt;strong&gt;caching creates a huge scalability advantage&lt;/strong&gt;. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4034578776695852095-3507280516515663697?l=dotnet-codes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet-codes.blogspot.com/feeds/3507280516515663697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4034578776695852095&amp;postID=3507280516515663697' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4034578776695852095/posts/default/3507280516515663697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4034578776695852095/posts/default/3507280516515663697'/><link rel='alternate' type='text/html' href='http://dotnet-codes.blogspot.com/2008/04/oop-in-net.html' title='OOP in .Net'/><author><name>Suman Biswas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://bp0.blogger.com/_hrre9HnkHlU/SElk5gZvEQI/AAAAAAAAACk/8lg9xnjxdRk/S220/suman.JPG'/></author><thr:total>0</thr:total></entry></feed>
