»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books
»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects
»Competition
Community
Winners
Prizes
Write For Us
Members
»Other Resources
Links
Dotnet Resources
|
Asp.net Page data cachingImagine a scenario where you have thousands of people visiting your website that means thousands of Continuos requests to the server and database which would result in severe performance hit.
To avoid this unnecessary trips to the server and database we can use the Asp.net page out put caching techniques.
you have to add the following directive to the top of the page
<% OutputCache Duration="5" VaryByParam="None" %>
|
The page looks likes below
<% OutputCache Duration="5" VaryByParam="None" %>
page caching
This Time will refresh in 5 seconds <%= DateTime.Now %>
|
The above page will show the current time only after 5 seconds. In that 5 seconds if you refresh the page it will show the initial time you called the page
|