DESIGNING .NET 4
WINDOWS APPLICATIONS:
DATA ACCESS LAYER

- CACHING

<system.web>

<caching>

<outputCacheSettings>

<outputCacheProfiles>

<add name="cache3Min" duration="180" varyByParam="none"

sqlDependency="Contoso:students" />

</outputCacheProfiles>

</outputCacheSettings>

</caching>

</system.web>

[ServiceContract]

[AspNetCompatibilityRequirements(RequirementsMode=AspNetCompatibilityRequirementsMode.Allowed)]

public class Service

{

[WebGet(Uritemplate = "{name}")]

[AspNetCacheProfile("cache3Min")]

public Student GetStudent(string name)

{

// ...

}

}