i'm issuing a request using MSXML's XmlHttpRequest object:
IXMLHttpRequest http = new XmlHttpRequest();
http.open("GET", "http://www.bankofcanada.ca/stat/fx-xml.xml", False, "", "");
http.send();
And the send succeeds, and i get my xml data.
Except that XmlHttpRequest didn't actually hit the network (i can see there no actual http request issued). And Process Monitor shows the file is actually being served from my cache:

So i want to instruct the XmlHttpRequest user agent that any cached content older than 0 seconds is too old. The standards way to do this is to add a request header:
Cache-Control: max-age=0
to the send request:
http = new XmlHttpRequest();
http.open("GET", "http://www.bankofcanada.ca/stat/fx-xml.xml", False, "", "");
http.setRequestHeader("Cache-Control", "max-age=0");
http.send();
And the send succeeds, and i get my xml data.
Except that XmlHttpRequest didn't actually hit the network (i can see there no actual http request issued). And Process Monitor shows the file is actually being served from my cache.
So what is wrong? Is max-age not doing what i think it does?
From RFC 2616 - Hypertext Transfer Protocol, Part 14: Header Field Definitions:
Other directives allow a user agent to modify the basic expiration mechanism. These directives MAY be specified on a request:
max-age
Indicates that the client is willing to accept a