I have a problem with Nginx's cache when an upstream returns a 0-byte 200 response. These 0-byte responses are very rare, but they are really apparent when the 0-byte 200 response gets cached for 1 hour.
With Nginx, you're able to set different TTLs for specific response codes, but I cannot figure out a way to set a really low TTL for a 0-byte 200 response or treat it like a 500 status code. Again, I'm trying to figure out why I'm getting the occasional 0-byte 200 response in my applications, but until then, it would be nice to have the ability to treat a 0-byte 200 status code response as a 500 error and not cache it.
Anybody have any experience with this?
Adam