Conclusion


Conclusion

Caching is a tried and true way to improve the performance of almost any system. By making frequently used content available quickly through the output cache, you can speed up the perceived performance of your application by a wide margin.

Turning on output caching in ASP.NET is a matter of including the correct directive at the top of your page. Naive use of the cache involves simply placing it on the page code and setting the Duration to some number and the VaryByParam attribute to none. However, you may also control various behaviors of the output cache by setting variables within the OutputCache directive. You may also control output caching behaviors through the HttpCachePolicy class, available through the Cache property of the Response object. ASP.NET supports cache profiles so you don't have to hard-code the caching parameters into the OutputDirective.

User Controls often represent a prime output caching opportunity—especially if they're navigation controls or some other control that doesn't change very often. By applying the OutputCache directive to the User Control, ASP.NET caches that part of the page on which it was placed.




Microsoft ASP. NET 2.0 Programming Step by Step
Microsoft ASP.NET 2.0 Step By Step (Step By Step (Microsoft))
ISBN: B002KE5VYO
EAN: N/A
Year: 2005
Pages: 177

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net