| title | IHttpResponse::GetKernelCacheEnabled Method |
|---|---|
| ms.date | 10/07/2016 |
| description | IHttpResponse GetKernelCacheEnabled Method determines whether the kernel cache is enabled for the current response. |
| ms.assetid | 26fd4e99-9c54-abfa-9782-86bdbee4ad05 |
Determines whether the kernel cache is enabled for the current response.
virtual BOOL GetKernelCacheEnabled(
VOID
) const = 0; This method takes no parameters.
true if the kernel cache is enabled for the current response; otherwise, false.
The GetKernelCacheEnabled method returns a Boolean value of true if kernel-mode caching is enabled for the current response, and it returns a value of false if caching is disabled.
Note
There are additional reasons why a response may not be cached by the server (for example, compression settings or Secure Sockets Layer settings). Therefore, a value of true does not mean that the response will be cached; it means only that caching is enabled.
The following code example demonstrates how to use the GetKernelCacheEnabled method to create an HTTP module that determines whether kernel caching is enabled for the current response. The module then returns this information to the client.
Note
Combine this example module with the example module that is listed for the IHttpResponse::DisableKernelCache method if you want to disable caching and return the status to the client.
[!code-cppIHttpResponseGetKernelCacheEnabled#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.
| 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 |
IHttpResponse Interface
IHttpResponse::DisableKernelCache Method
IHttpResponse::GetCachePolicy Method