I enabled the caching of static image files in appengine using the following in my appengine-web.xml:
<static-files>
<include path="/css/images/**.gif" expiration="1d" />
<include path="/css/images/**.png" expiration="1d" />
<include path="/css/images/wind_pointers/*.png" expiration="7d" />
<include path="/css/images/**.jpg" expiration="1d" />
<include path="/errors/*" />
</static-files>
This worked very well until I discovered an odd side effect: Sometimes, appengine serves up a JavaScript file with the content of my HTML page, so the result is that I get loads of JavaScript errors because the JavaScript interpreter is being fed HTML instead of JS:

Now, if I simply comment out that static-files section in appengine-web.xml that I mentioned above, everything works fine: .js files are served up with their own content and I have no problems:

This seems odd to me. The .js files aren't even in the directories specified in that static-files section. Have I got the syntax wrong in my appengine-web.xml that is causing some wierd bug to manifest?
Luckily, I am able to reproduce this easily and reliably on both the deployed app and my local dev server, by simply commenting out the static-files section in appengine-web.xml. It happens in both Chrome and IE. I'm using the Java appengine.