Skip to content

Latest commit

 

History

History
67 lines (51 loc) · 4.85 KB

File metadata and controls

67 lines (51 loc) · 4.85 KB
title CACHE_OPERATION Enumeration
description Describes the CACHE_OPERATION enumeration and provides its members, remarks, a code example, and requirements.
ms.date 10/07/2016
ms.assetid eac89782-7b9b-1fb3-c267-712522b7c96b

CACHE_OPERATION Enumeration

Defines the enumeration values for cache operations.

Syntax

typedef enum CACHE_OPERATION {  
   CACHE_OPERATION_RETRIEVE,  
   CACHE_OPERATION_ADD,  
   CACHE_OPERATION_DELETE,  
   CACHE_OPERATION_FLUSH_PREFIX,  
   CACHE_OPERATION_ENUM  
};  

Members

Member name Description
CACHE_OPERATION_RETRIEVE Indicates that data is being retrieved from the cache.
CACHE_OPERATION_ADD Indicates that data is being added to the cache.
CACHE_OPERATION_DELETE Indicates that data is being deleted from the cache.
CACHE_OPERATION_FLUSH_PREFIX Indicates that all data entries whose keys have a given prefix are being removed from the cache.
CACHE_OPERATION_ENUM Indicates that the cache is being enumerated.

Remarks

CGlobalModule derived classes registering for GL_CACHE_OPERATION events receive an ICacheProvider pointer as a parameter on the CGlobalModule::OnGlobalCacheOperationvirtual method. You can then retrieve a CACHE_OPERATION enumeration value by calling the ICacheProvider::GetCacheOperation method on the ICacheProvider pointer.

To determine which cache was affected by the cache operation, see the IHttpCacheKey::GetCacheName method.

Example

The following code example demonstrates how to create a global module that listens for GL_CACHE_OPERATION and GL_CACHE_CLEANUP events and then writes the CACHE_OPERATION information to the Event Viewer.

Caution

[!INCLUDEiisver] generates a large number of events in the Event Viewer. To avoid a log overflow error in a production environment, you should generally avoid writing cache information to the event log. For demonstration purposes, this code example writes an entry to the Event Viewer in debug mode only.

[!code-cppEnumerations#1]

For more information on how to create and deploy a native DLL module, see Walkthrough: Creating a Request-Level HTTP Module By Using Native Code .

The above code writes a new event to the Event Viewer, where the Data node holds a string similar to the following.

GetCacheOperation: CACHE_OPERATION_RETRIEVE  

You can optionally compile the code by using the stdcall (/Gz) calling convention instead of explicitly declaring the calling convention for each function.

Requirements

Type Description
Client - IIS 7.0 on [!INCLUDEwinvista]
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on [!INCLUDEwinsrv2008]
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
- [!INCLUDEiisexp75], [!INCLUDEiisexp80], [!INCLUDEiisexp100]
Header Httpserv.h

See Also

IHttpServer::DoCacheOperation Method
ICacheProvider::GetCacheOperation Method
CGlobalModule::OnGlobalCacheOperation Method