Share via


Caching Method Results and Property Values

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

Sometimes, method calls in enterprise-level or complex applications can be expensive in terms of resources and take appreciable time to execute. If the application repeatedly calls such methods during its execution, the judicious use of caching can reduce the demands the application places on hardware and system resources; it can also increase perceived response times.

The Policy Injection Application Block provides a handler that takes advantage of the features exposed by the ASP.NET caching mechanism to cache the return value from a specified method call. This allows developers to improve application efficiency without requiring them to write the caching code to manage method return values. The Caching Handler is also useful for caching the values of properties exposed by classes, particularly where the class must execute complex processing in order to generate the property return value.

For more details about caching parameter values and results using the Policy Injection Application Block, see The Caching Handler in the section Configuring and Using Pipeline Handlers. For details about the underlying caching mechanism, see ASP.NET Caching Overview in the main .NET Framework SDK documentation.