Suppose I have a grid view in an asp.net web page, where I am showing some data from a database. These data have to be updated every 20 seconds. If multiple users log in to the same page, they will see the same data in that grid view. So, if, somehow I can cache those data, then it will be more faster in the multi-user scenario.
In my grid view, there are two columns, each displaying some floating point numbers, and I have 500+ of such rows.
How can I cache those data?
Use the OutputCache directive on your page.
This will keep the page in cache for 20 seconds, and the next time it is requested after the 20 seconds is up, it will be refreshed.