It's a really strange problem. I believe it to be a server issue, but it's so strange and hard to reproduce that I'm not entirely sure.
Just as the title says I'm receiving responses for earlier requests. And not just from the same client.
I'm developing an iPhone app with a server component. The server is running apache2, mod_wsgi, and a django webapp.
All responses are JSON, all POSTs are made with JSON as the request raw body, and all requests wrapped in SSL.
For instance I may make a request to /login/ and receive a perfectly good response. Later I may make a request to /registration/ and receive a JSON dictionary with a registration failed response (even though it doesn't really fail) along with key/values for data returned in the previous /login/ request! Sometimes a key/value pair will be returned for up to 5 requests later.
And this is happening between app launches. I even had this happen in a browser with a request I had previously made from the app. In this instance a made a GET request for a user profile and received the JSON response for an earlier login attempt (without any of the data expected for the current request).
As I shot in the dark, I have disabled memcache and turned off Keep-Alive. Other than disabling Keep-Alive I'm just running a default ubuntu apache configuration.
Restarting Apache appears to temporarily fix it in most cases.
Any help is appreciated!