Click here to Skip to main content
15,919,479 members

Comments by Vipul Mehta (Top 4 by date)

Vipul Mehta 19-Aug-13 14:38pm View    
I have implemented below code within the BeginRequest application event within my custom HttpModule class and registered it within the config file. But still within my response header, I see Cache-Control:private.

I am using IE8 and Fiddler web debug tool to monitor my responses.

public class AddCustomHeaderModule : IHttpModule
{
public void Init(HttpApplication context)
{
context.BeginRequest += new EventHandler(context_BeginRequest);
}

void context_BeginRequest(object sender, EventArgs e)
{
if (HttpContext.Current.Response != null)
{
HttpContext.Current.Response.AppendHeader("Cache-Control", "no-store, no-cache, must-revalidate");
HttpContext.Current.Response.AppendHeader("Pragma", "no-cache");
HttpContext.Current.Response.AppendHeader("Expires", "0");
}
}
}

<httpmodules>
<add name="AddCustomHeaderModule" type="Namespace.AddCustomHeaderModule">
Vipul Mehta 15-Aug-13 16:32pm View    
Yes my page exists there. Following are my server details

OS - Server 2008 Enterprise SP2
IIS - 7.0
App Pool framework version - v2.0


Is this something to do with the App pool framework version?

Below is my latest web config settings with Blank.htm file exists on the application root folder.
<pre lang="xml">
<httperrors errormode="Custom">
<remove statuscode="403" substatuscode="-1">
<error statuscode="403" path="/Blank.htm" responsemode="ExecuteURL">
</error></remove></httperrors>
Vipul Mehta 15-Aug-13 15:27pm View    
I implemented below settings but now I get 404 Page not found error. We have this page within application root folder. Is this something to do with the IIS version on our server?

<httperrors errormode="Custom">
<remove statuscode="403" substatuscode="-1">
<error statuscode="403" path="/Blank.htm" responsemode="ExecuteURL">
Vipul Mehta 15-Aug-13 10:17am View    
I have created an httpModule class and have implemented this code there. I am using Web Forms with ASP.Net 3.5.