I am having serious issues with com.sun.net.httpserver.HttpExchange and sending 304s, as explained in the plovr discussion group.

This is a simple test page to demonstrate the issue.

It turns out that the Java behavior is so bad that I cannot even imitate it in PHP!

Fortunately Node JS provides lower-level access to HTTP so I could create a test server that imitates the Java behavior: etag.js.