Mysterious ~ 1 minute delay in HTTP POST between browser and Nginx

Recently, we have encountered a very strange but very consistent delay in sending mail from client javascript to our server.

Here is our technology stack, front and back:

  • Custom javascript client code
  • Backbone.js
  • Custom implementation of Backbone.sync ()
  • jQuery.ajax () (1.7.2)
  • XmlHttpRequest
  • Browser (tested on both Firefox and Chrome)
  • the Internet
  • Nginx interface
  • Intranet (via Nginx http://upstream)
  • Nginx backend
  • Gunicorn (via Nginx unix://upstream socket)
  • Django 1.4
  • Django-tastypie

(Side note: Do you ever just step back from how complicated web development is?)

Here's the timeline:

  • .save() Backbone APIModel.
  • .sync() client.send(), $.ajax().
  • XmlHttpRequest POST. dev Network, .
  • HTTP- Nginx, django-tastypie.
  • Tastypie , 201 CREATED Location, .
  • Nginx () .
  • 1,1 elapse,, - Network.
  • .
  • jQuery xhr
  • API- 201 GET .
  • , GET , $.Deferred() , .

:

  • GET PUT .
  • Nginx HTTP- POST, , .
  • 201 GET .
  • 1,1 . console.time(), , 65 000 .
  • . , .

, :

  • Nginx , .
  • jQuery.

, , , , , :

  • -

# 3. ?

+5
1

! Content-Length, , , . @MaxDounin , .

Django django.middleware.http.ConditionalGetMiddleware . ( Content-Length.)

+3

All Articles