Lately I have been developing a web application using Google App Engine. During development I use Firefox extensively to check the layout of the application. Every once in a while I also check the site under IE7.
Yesterday I ran into some strange problems. I use jQuery to issue ajax calls, to update parts of the screen, but under IE7 a DIV did not seem to be updated. After checking the development web server, I noticed that the Ajax call was not sent. Since I am pretty sure the Ajax call was issued, something else was going on.
Caching
The most probable cause was, that IE7 is caching the contents. Since I did not explicitly set caching options on the response, I checked this using Firebug. However, Firebug doesn’t show this. So I turned to “curl” using the verbose option. That clearly showed:
Cache-Control: no-cache
And that’s exactly what I want! So, why does it not work? I did notice the development web server responded with HTTP/1.0. After “googling” around a bit, it turns out that the Cache-Control header was added in HTTP/1.1. IE7 was just very strict in applying the standards (that’s a change!).
Upgrading the development server
In trying to get this working on the Google App Engine development web server, I digged into the code of the DevAppServerRequestHandler class and added:
protocol_version = 'HTTP/1.1'
This turned out to be a bad idea. IE7 now got stuck when the page was loaded. According to the dev. web server the response was sent, but IE7 was still waiting for more. So, I reverted that change and tested it by deploying a new version to the Google App Engine, since this does support the HTTP/1.1 protocol. Now everything worked fine in IE7, the Ajax response was not cached and reloaded every single time…