Rutt

SSL and Caching IE Issue

Recommended Posts

Hi guys,

 

 

 

I seem to be caught between a rock in a hard place here and I'm quite frustrated.

 

 

 

I have a chart (map) where you can drill down into the country. Upon first load it shows the data just fine. Upon changing a parameter, it changes the data for the top of the map, but when you drill down, it has the data from the previous parameter. It seems to cache the XML or the .SWF. This only occurs in Internet Explorer. So the fix for this is to disable caching on the page:

 

 

 

HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));

 

HttpContext.Current.Response.Cache.SetValidUntilExpires(false);

 

HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);

 

HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);

 

HttpContext.Current.Response.Cache.SetNoStore();

 

 

 

This works great! That is until I enabled SSL on the entire website. When I did that, I get "error in loading data." upon drill down. So I searched these great forums and found the solution as follows:

 

 

 

Cache-Control: cache, must-revalidate

 

Pragma: public

 

 

 

Well doing this fixes the "error in loading data" problem but then the IE caching issue comes back.

 

 

 

Any ideas on what will fix BOTH of these issues?

 

 

 

I've tried entering nocache=GetCurrentTime statements to no avail. I get random millisecond values, but it doesn't seem to help.

 

 

 

Thanks in advance. I'm a paying customer. I have a ticket in (#5523) but response is slow - I assume because of the geography.

Share this post


Link to post
Share on other sites

Hello,

 

 

 

We have already replied to your Ticket. :P

 

 

 

Could you please pass noCache attribute to the URLs that are generating XMLs and try once?

 

 

 

Example:

 

mapchartdata.aspx?noCache={random number}

 

 

 

Hope this helps.

Share this post


Link to post
Share on other sites

The issue has been resolved thanks to FusionCharts support!

 

 

 

I ended up having to "double escape" the URLs.

 

 

 

So the magic combination for me was...

 

 

 

1.

 

 

 

System.Web.HttpResponse response;

 

response = System.Web.HttpContext.Current.Response;

 

response.AppendHeader("Pragma", "public");

 

response.AppendHeader("Cache-control", "cache, must-revalidate");

 

 

 

on the XML provider page.

 

 

 

2. Setting nocache=DateTime.Now.Ticks.ToString() on all .swf and xml providing URLs

 

 

 

3. Escaping twice in the URL:

 


linkURL = Server.UrlEncode("javascript:updateMap("" + this.getMapFile(dr["CountryID"].ToString()) + "","" + Server.UrlEncode("mapchartdata.aspx?country=" + dr["countryID"].ToString() + "&noCache=" + DateTime.Now.Ticks.ToString()) + "");");

 

 

 

4. Escaping in the javascript that renders the map on drill-down

 

Map_mapChart.setDataURL(escape(dataURL + "?currTime=" + getTimeForURL()));



function getTimeForURL() {

   var dt = new Date();

   var strOutput = "";

   strOutput = dt.getHours() + "_" + dt.getMinutes() + "_" + dt.getSeconds() + "_" + dt.getMilliseconds();

   return strOutput;

}

Edited by Guest

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now