If your ASP.NET page contains processing and db calls and you know that it’s output is not changing that frequently then you must cache you page out. It is easy to do this in ASP.NET
1 2 3 | <%@ outputcache duration="3600" varybyparam="none" %> |
Above code will cache the page for 3600 seconds, whihc means that page will be processed only once in every 1 hour
In case the page content vary by url parameters then you must specify the name of all parameters separated by semi-colon as shown in below example
1 2 3 | <%@ outputcache duration="100" varybyparam="employeeId;companyId" %> |
ASP.NET will automatically take care of in case parameters are changed and adjust the caching accordingly.