Output Caching

Web Forms—the Page class—define a Cache property. Cache functions like a data dictionary of name and values. By associating a key with an object in the cache, you can store processor-intensive data the first time you request it.

The ease with which you can use the cache is part of what makes it so powerful. Assume that you run a query on the code database that returns a DataTable of source code. You can store that DataTable in the cache. You can manipulate the data in the cache instead of requerying the database. If you modify data in the cache, you can update the database from the cache.

This is especially useful for CPU-intensive processes like sorting database queries. Instead of a thousand users all hitting the database, when ...

Get Visual Basic® .NET 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.