I proxy some requests through 127.0.0.1 and couldn't figure out why Quick Cache wasn't doing it's job. I tried every documented feature (env variable, defines, get params) -- nothing worked. Finally I went into the code -- intent on removing the offending check. That's when I found a check for the LOCALHOST constant. OMG. Why do that if you're not going to document it???
Anyway, adding teh following to my wp-config.php file fixed it.