In ASP.NET, .NET3.5 and IIS7, can you cache commonly used controls so you don’t have to rebuild them on a each page load?
I have an asp control, in this case a telerik treeview control, but this question is for asp controls in general. I’m simply going to use my treeview to illustrate what I’m looking for.
I’m building a telerik treeview control that is populated with data from a (expensive) query to my database.
I was thinking, I could cache the results of the query in a table and have a scheduled sproc run every 15 minutes and update this caching table.
Then I figured the built control will not change either, so is there any way, using IIS to keep a version of a built control so I can eliminate all the code behind logic needed to assemble it. Afterall, it is the same everytime. I could save bandwith between IIS and SQL as well as CPU cycles.
If you make your treeview into a usercontrol, you can use the “OutputCache” directive to cache its contents: http://msdn.microsoft.com/en-us/library/h30h475z(VS.90).aspx