[ale] OT: XMLHTTP + IE FOUND IT!!

Jay Loden jloden at toughguy.net
Fri Dec 15 21:04:00 EST 2006


So IE was caching the page? Now that you mention it, the same thing happened to me when I 
was testing some simple scripts. My production scripts with dynamic content pass the 
following headers to IE for that reason:

   http.header("Last-Modified: " + http.epoch2http(time.time() - 1200))
   http.header("Cache-control: no-cache")
   http.header("Pragma: no-cache")
   http.header("Expires: -1")

http is a module of my own functions, and epoch2http takes a number of seconds since the 
epoch and converts it to HTTP header format. The rest are headers recommended on MSDN to 
force IE not to cache dynamic content (Firefox works correctly even without the extra 
headers, as I'm sure you've surmised).

-Jay

cfowler wrote:
>     req.open("GET", "/SC/Test/alarm_check.pl", false);
>     req.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00
> GMT" );
>     req.send(null);
> 
> 
> I had to force IE to get the goods!
> 
> This page lists known bugs or issues!
> 
> 
> http://en.wikipedia.org/wiki/XMLHttpRequest



More information about the Ale mailing list