Modify HTTP response headers to prevent IE caching

I am trying to get a rabbitweb XML file called with AJAX to not cache in IE. Works great in Firefox, Chrome and all other browsers, but IE’s aggressive caching is becoming quite problematic.

I tried following some advice I found on the rabbit forms, and added

#define HTTP_CUSTOM_HEADERS(state, buffer, bytes) nocacheHeader(state, buffer, bytes)

with the callback function

void nocacheHeader(HttpState* state, char* buffer, int bytes){
strcpy(buffer, "Cache-Control: no-cache

but this simply bricked the card I was trying to use for all HTTP traffic. Obviously my callback was not effective, but there is insufficent documentation for me to understand why.

Does anyone have any better documentation (since there is only one mention if HTTP_CUSTOM_HEADERS in the release notes for DC10.66, but nothing more concrete than that.

Is this even the best approach for doing this task? Can anyone recommend any better reading on the subject that might shed some light on why this is such a diffacult problem.

And before you suggest it: I tried the trick of appending something in my XMLHttpRequest() like: rabbbitweb.xml?t=RANDNUM and that causes my authentication window on my page to flash endlessly every 200ms (how frequently I poll my XML file)… That also seems to me like a very clumsy answer compared to modifying the HTTP response headers appropriately.

Make sure you are using DC10.72. That version contains the following bug fix:

  • Defect #41912. When HTTP_CUSTOM_HEADERS is defined and used, an incorrect buffer offset calculation results in corrupted HTTP header buffer content.

Thank you for your time. Yes I am using V10.72, and its definitely not a corruption in the HTTP headers, it seems to be a by design part of IE, that I can’t seem to tell how to shut off.

So really its really: How do I get IE to stop trying to cache my XML file…