Skip to content

Latest commit

 

History

History
137 lines (115 loc) · 7.43 KB

File metadata and controls

137 lines (115 loc) · 7.43 KB
title IHttpCacheSpecificData Interface
description Describes the IHttpCacheSpecificData interface and details its syntax, methods, derived classes, remarks, inheritance hierarchy, and requirements.
ms.date 10/07/2016
ms.assetid 2cdc07d4-1786-31ca-28fa-7b57db3c5f8f

IHttpCacheSpecificData Interface

Provides information and access methods for data that is stored in a global cache.

Syntax

class IHttpCacheSpecificData  

Methods

The following table lists the methods exposed by the IHttpCacheSpecificData interface.

Name Description
DecrementTTL Decrements the Time-to-Live (TTL) setting of the cached data.
DereferenceCacheData Decrements the internal reference count for the cached data.
GetCacheKey Returns the cache key associated with the cached data.
GetFlushed Returns a value indicating whether the specific data has been flushed from the cache.
ReferenceCacheData Increments the internal reference count for the cached data.
ResetTTL Resets the Time-to-Live (TTL) setting of the cached data.
SetFlushed Sets a value indicating that the specific data is to be flushed from the cache.

Derived Classes

Name Description
IHttpFileInfo Extends the IHttpCacheSpecificData interface by adding file-specific information for files that are cached on a server.
IHttpTokenEntry Extends the IHttpCacheSpecificData interface by adding token-specific information for tokens that are cached on a server.

Remarks

You can retrieve an IHttpCacheSpecificData pointer from an ICacheProvider pointer by calling the ICacheProvider::GetCacheRecord 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 IHttpCacheSpecificData 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-cppIHttpCacheSpecificData#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 new events to the application log of the Event Viewer, where the Data box contains XML similar to the following.

<cacheProvider>  
    <cacheSpecificData   
        flushed="false">  
        <uriKey   
            siteId="1"   
            siteName="Default Web Site"   
            url="/DEFAULT.HTM"   
            cacheName="URI"   
            hash="59390334"   
            isEqual="true"   
            isPrefix="true"/>  
    </cacheSpecificData>  
</cacheProvider>  
<cacheProvider>  
    <fileInfo   
        changed="false"   
        attributes="32"   
        eTag=""5e5e714ef4dc61:0""   
        buffer="false"   
        handle="valid"   
        path="C:\INETPUB\WWWROOT\DEFAULT.HTM"   
        cacheAllowed="true"   
        secondsToLive="-1"   
        lastModifiedString="Tue, 21 Mar 2006 17:45:56 GMT"   
        lastModifiedTime="valid"   
        size="92"   
        vrPath="C:\inetpub\wwwroot"   
        vrToken="NULL"   
        flushed="false">  
        <contextContainer>  
            <storedContext/>  
        </contextContainer>  
        <fileKey   
            path="D:\INETPUB\WWWROOT\DEFAULT.HTM"   
            cacheName="FILE"   
            hash="206817538"   
            isEqual="true"   
            isPrefix="true"/>  
    </fileInfo>  
</cacheProvider>  
<cacheProvider>  
    <tokenEntry   
        impersonationToken="valid"   
        primaryToken="valid"   
        sid="valid"   
        flushed="false">  
    <tokenKey   
        userName="IUSR"   
        passwordHash="1234567890"   
        logon="3"   
        cacheName="TOKEN"   
        hash="0"   
        isEqual="true"   
        isPrefix="false"/>  
    </tokenEntry>  
</cacheProvider>  

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

Inheritance Hierarchy

IHttpCacheSpecificData

IHttpFileInfo

IHttpTokenEntry

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

Web Server Core Interfaces
IHttpFileInfo Interface
IHttpTokenEntry Interface