Any resolution on this? I'm experiencing the same issue:
Super fast DB/network/responses on production environment
Super fast DB/network/responses on local environment with local DB
Super fast DB/network but ULTRA SLOW LOCAL RESPONSES on local environment with remote DB
I have absolutely verified the issue is not DB query related or network latency related. It is the local Django instance delaying responses to the local client for many, many seconds. In some cases, 10's of seconds.
In fact, the local Django server even logs its response in the console almost immediately but the client doesn't receive the response from the local Django sever for an inexplicable amount of time.
I appreciate other posters suggesting investigating query optimization, network topology optimization, etc. but that is NOT the problem.
The problem is something in the Django infrastructure imposing incredibly long local response times after the response has been processed.