troubleshooting Question

prevent page caching

Avatar of Cjames
CjamesFlag for United States of America asked on
ASP.NETWeb ServersC#
18 Comments1 Solution1176 ViewsLast Modified:
We've got a website which is having intermittent caching problems -- as soon as the user clears their cache the problems are not recreatable for some unforceable time for that user.  The website is hosted at GoDaddy, so I can't change IIS settings.  This caching problem is threatening the entire business model.

I should mention this appears to be affecting IE8 only, it has not been known to happen on IE7, Safari, Chrome, or Firefox.

I have put Response.Cache.SetCacheability(HttpCacheability.NoCache); in the page load, I have put <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Expires" CONTENT="-1">  in the header.

I just found the following, do I need to put this on every page, will it fix the problem, or do we need to find a host that will turn off caching and does anybody have any idea what host does that?

 Response.ClearHeaders();
        Response.AppendHeader("Cache-Control", "no-cache"); //HTTP 1.1
        Response.AppendHeader("Cache-Control", "private"); // HTTP 1.1
        Response.AppendHeader("Cache-Control", "no-store"); // HTTP 1.1
        Response.AppendHeader("Cache-Control", "must-revalidate"); // HTTP 1.1
        Response.AppendHeader("Cache-Control", "max-stale=0"); // HTTP 1.1  
        Response.AppendHeader("Cache-Control", "post-check=0"); // HTTP 1.1  
        Response.AppendHeader("Cache-Control", "pre-check=0"); // HTTP 1.1  
        Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.1  
        Response.AppendHeader("Keep-Alive", "timeout=3, max=993"); // HTTP 1.1  
        Response.AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); // HTTP 1.1

Thanks
ASKER CERTIFIED SOLUTION
pradyahuja

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 18 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 18 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros