Using an Absolute Cache Expiration Policy

When you use an absolute cache expiration policy, the data that a DataSource represents is cached in memory for a particular duration of time. Using an absolute cache expiration policy is useful when you know that your data does not change that often. For example, if you know that the records contained in a database table are modified only once a day, there is no reason to keep grabbing the same records each and every time someone requests a web page.

Warning

When caching with the SqlDataSource control, the SqlDataSource control’s DataSourceMode property must be set to the value DataSet (the default value) rather than DataReader.

The page in Listing 29.27 displays a list of movies cached in memory. ...

Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.