Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 3.63 KB

ihttpresponse-getcachepolicy-method.md

File metadata and controls

51 lines (38 loc) · 3.63 KB
title description ms.date ms.assetid
IHttpResponse::GetCachePolicy Method
The IHttpResponse::GetCachePolicy Method returns a pointer to an I H t t p Cache Policy interface, which enables you to call any one of the available methods for that interface.
10/07/2016
ca34e089-b2d7-386a-e3f5-4c7dfa213d91

IHttpResponse::GetCachePolicy Method

Retrieves the response output cache policy.

Syntax

virtual IHttpCachePolicy* GetCachePolicy(  
   VOID  
) = 0;  

Parameters

This method takes no parameters.

Return Value

A pointer to an IHttpCachePolicy interface.

Remarks

The GetCachePolicy method returns a pointer to an IHttpCachePolicy interface, which enables you to call any one of the available methods for that interface.

Note

The server owns the lifetime of the IHttpCachePolicy interface, and the interface is available through the end of your response processing.

Example

The following code example demonstrates how to use the GetCachePolicy method to return a pointer to an IHttpCachePolicy interface, and it uses the IHttpCachePolicy::IsUserCacheEnabled method to determine whether the user cache is enabled. The module then returns the status to the client.

[!code-cppIHttpResponseGetCachePolicy#1]

Your module must export the RegisterModule function. You can export this function by creating a module definition (.def) file for your project, or you can compile the module by using the /EXPORT:RegisterModule switch. For more information, see Walkthrough: Creating a Request-Level HTTP Module By Using Native Code.

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

IHttpResponse Interface
IHttpResponse::DisableKernelCache Method
IHttpResponse::GetKernelCacheEnabled Method