Do this | |
---|---|
Cache page or user control output |
Add the @ OutputCache directive to the page or user control, or use the methods exposed by Response.Cache. |
Vary the cache based on user input |
Add the VaryByParam, VaryByHeader, or VaryByControl attributes to the @ OutputCache directive. |
Cache arbitrary data |
Insert items into the cache using either the simple syntax Cache[“myKey”] = myItem; or call the Add or Insert methods of the Cache class. |
Expire a cache item when another item changes |
Insert the item to be expired with a key dependency on the other cache item. |