Walkthrough: Flushing the Cache

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.

This walkthrough demonstrates how to flush the cache. Flushing the cache empties it of all data.

To reproduce this demonstration

  1. Configure the cache. For the necessary steps, see "QuickStart Configuration" in Caching QuickStart.

  2. Declare a member variable of type ICacheManager to store the CacheManager object in the QuickStartForm class.

    private ICacheManager primitivesCache;
    
    'Usage
    Private primitivesCache As ICacheManager
    
  3. In the method that responds to the user's request to flush the cache, add the following code.

    this.primitivesCache.Flush();
    
    'Usage
    Me.primitivesCache.Flush()