Microsoft.ASP.Dot.NET.Programming.with.Visual.Basic.Dot.NET.Version.1002003.Step.By.Step [Electronic resources]

G. Andrew Duthie

نسخه متنی -صفحه : 126/ 82
نمايش فراداده

Chapter 12 Quick Reference

To

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.