The easiest way to implement caching in your ASP.NET web applications is through directives at either the page or the user control level. Unfortunately, this method is also the most limiting and frustrating to work with.
The basis for output caching at both the page and the user control level is the @OutputCache directive. Although you can use many different possible attributes (a few of which you’ll see in a bit), two are mandatory: Duration and VaryByParam.VaryByControl can be substituted for VaryByParam in user controls, however.
The Duration attribute is fairly straightforward, but you must realize that the number it accepts is the number of “seconds” that you want your content to be cached ...