Configure Output Caching Through the Web.config File
You can also configure the caching feature in the local Web.config file, which is found in the content directory. Below is a sample of the configuration needed for a ShowStockPrice.asp page with a varyByQueryString parameter of * (meaning cache all unique variations of querystring parameters) and a timeout of 1 second.
<configuration>
<location path="showStockPrice.asp">
<system.webserver>
<caching>
<profiles>
<add varybyquerystring="*"location="Any"
duration="00:00:01" policy="CacheForTimePeriod"
extension=".asp">
</profiles>
</caching>
</system.webserver>
</location>
</configuration>
If you want to cache this data in kernel for even faster performance, you just need to change the policy attribute to kernelCachePolicy.
Note: Microsoft ASP.NET already includes an output cache feature; The IIS output cache feature works in parallel with the ASP.NET cache and works for all types of applications.