For example, my home page shows a few of the newest products. I would like to set this page to be cached indefinitely, and then when I create a new product I could delete the cached page in my code, rather than caching for a certain time period, and hoping users are seeing the most up to date content.
Also, once I clear the cache can I use an HttpWebRequest to invoke those pages to be cached again so that a user doesn't have to?
I understand that I can use partial page caching, but i'm really not interested in breaking up my pages into user controls.
Note: I do have access to the server, and IIS.
If the database your using is SQL Server, you can use SQL cache dependency (SqlCacheDependency) for the purpose of caching, it enable you to cache your pages that are dependent on data from database. As soon as the data in your database table changes, it will invalidate the cache and next time the new page will be generated...
For more and sample, here is the link: http://msdn.microsoft.com/en-us/library/e3w8402y(v=vs.80).aspx and also from www.asp.net you can download a video tutorial too
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With