Situation: running a Google App Engine site with my static content’s default_expiration set to “14d”
Problem: in Chrome and Safari, visiting a URL (not reloading, just putting the cursor in the address bar and hitting Enter), causes a ton of requests to be fired with If-None-Match headers. The responses are always 304 Not Modified, as expected. I can watch these requests get fired in a debugging proxy like Charles or Fiddler.
Want: to avoid these requests and 304 responses entirely for static content — simply trust the browser’s cached content when it’s available.
We use the standard “cache static content for a really long time, we’ll take care of appending ?version={version} modifications to our query strings when we need to bust the cache” system, so we’d really like to avoid the 304’s.
Belief: I think this is caused by the etag header that app engine sends down with every static content response. The app engine SDK does not send this header down, and I don’t see this 304 behavior when messing around with the SDK.
Any advice? Can you turn off etags for app engine’s static content?
Updated with an example piece of static content: http://www.khanacademy.org/stylesheets/shared-package/compressed.css
While I don’t believe there is any way to control the etags header behavior for GAE, this is caused by a bug in WebKit that causes all static content to be re-downloaded when receiving a 302 redirect after a POST request.
Once WebKit fixes this bug, the issue should go away.
If you must, you can temporarily work around this specific redirect-after-POST bug by redirecting via a Refresh header instead of using a 302 redirect.
https://bugs.webkit.org/show_bug.cgi?id=38690
WebKit image reload on Post/Redirect/Get
http://www.google.com/support/forum/p/Chrome/thread?tid=72bf3773f7e66d68&hl=en