"If-Modified-Since" Fix (IIS7 and Windows 7)

Fellow ZingChart tinkerer and ColdFusion user Scott Stroz recently came to us with an issue he was running into using our charts with IIS7 on Windows 7 throwing a bad request. To be exact:

"@ZingChart The problem is that ZingCharts uses "If-Modified-Since" (apparently for no real reason) and IIS on Win7 chokes on it."

Issue response and fix

We dug into the issue and since the response was a character or two more than 140, I figured I'd post the response here for all to see. So here it is from our dev team:

We used that HTTP header to make sure we get the fresh (and not cached) data from the server. The fact that on IIS7/win7 this is not implemented is not really a zing issue. 

However, to offer an alternative, in 0.120731 which is the current live version, I've implemented an option on render() call called

cache-control (or cacheControl) 

with the following possible values: "http-headers" (default), "query-string" and "none"

  • When "http-headers" is used, the If-Modified-Since header is used. 
  • When "query-string" is used a parameter called zcrandom is appended to the query string (beware that on IIS6 this fails when requesting static files, so requests like data.txt?a=1 are not accepted by IIS6).
  • When "none" is used, there is no "cache preventing" method from the browser so its the server's "responsibility" to provide the fresh or cached data. 
    Hope this helps! Thanks to Scott for pointing out the issue so we could make sure a workaround is available for our users.