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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.