Monday, November 15, 2010

Wicket, Open Flash Chart, HTTPS and Internet Explorer

NextReports Server uses Open Flash Chart to present charts inside dashboards.

After setting a https server, on Internet Explorer all the flash widgets showed a #2032 Error. Firefox was working as expected. This was obviously an Internet Explorer bug and the solution to it was to add two response headers : "Pragma" and "Cache-Control".

Testing again, everything was ok, except refresh action. A refresh on IE wouldn't load the chart. The problem was IE cache. Also no drill down was possible because of this. The cache mechanism in Internet Explorer is different from that used by other browsers like Firefox. So we need to force IE to not cache flash. We add another response header "Expires" and set it to -1, and also we used "no-store" value  for "Cache-Control".

Final solution was to use in our WebResource the following :
protected void setHeaders(WebResponse response) {
    response.setHeader("Pragma", "public");
    response.setHeader("Cache-Control", "no-store, must-revalidate");
    response.setHeader("Expires", "-1");           
}     

No comments: