IHttpCacheSpecificData Interface

IIS 7.0
 

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

class IHttpCacheSpecificData

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.

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.

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.

System_CAPS_cautionCaution

IIS 7 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.

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="&quot;5e5e714ef4dc61:0&quot;" 
        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.

IHttpCacheSpecificData

   IHttpFileInfo

   IHttpTokenEntry

Requirements

Type

Description

Client

  • IIS 7.0 on Windows Vista

  • IIS 7.5 on Windows 7

  • IIS 8.0 on Windows 8

  • IIS 10.0 on Windows 10

Server

  • IIS 7.0 on Windows Server 2008

  • 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 Technical Preview

Product

  • IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0

  • IIS Express 7.5, IIS Express 8.0, IIS Express 10.0

Header

Httpserv.h

Show: