Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8640289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:14:36+00:00 2026-06-12T11:14:36+00:00

We’ve lately been experiencing a very strange but very consistent delay when POSTing from

  • 0

We’ve lately been experiencing a very strange but very consistent delay when POSTing from client-side javascript to our server.

Here’s our technology stack, from front to back:

  1. Custom javascript client code
  2. Backbone.js
  3. Custom Backbone.sync() implementation
  4. jQuery.ajax() (1.7.2)
  5. XmlHttpRequest
  6. Browser (verified on both Firefox and Chrome)
  7. Internet
  8. Nginx front-end
  9. Intranet (via Nginx http:// upstream)
  10. Nginx back-end
  11. Gunicorn (via Nginx unix:// upstream socket)
  12. Django 1.4
  13. django-tastypie

(Side note: do you ever just step back in awe at how complicated web development is?)

Here’s a timeline of events:

  1. Client code calls .save() on a newly created Backbone APIModel.
  2. Our custom .sync() winds its way to client.send() which dispatches the newly created object to $.ajax().
  3. The resulting XmlHttpRequest POSTs. The request appears in the browser dev tool’s Network pane, marked as pending.
  4. The HTTP request reaches Nginx, which routes it to the django-tastypie backend.
  5. Tastypie handles the request promptly and flawlessly, creating the resource, and returning a 201 CREATED response, with a Location header pointing to the new resource.
  6. Nginx logs the request and (ostensibly) sends the response.
  7. 1.1 minutes elapse, during which the request is still marked as pending in the Network pane.
  8. The request is marked as complete in the browser’s Network pane.
  9. The jQuery xhr fires success handlers
  10. Our custom API client’s success handler detects the 201 response code and fires off a subsequent GET request to the Location.
  11. The usual stuff happens, the GET responds promptly, and the outermost $.Deferred() object resolves, firing any associated client code success handlers.

Other details to consider:

  1. GET requests and PUT requests in the same stack resolve promptly.
  2. When interacting directly with the outermost Nginx via a dedicated HTTP client, POST requests identical to the request in question resolve promptly.
  3. Removing the special-case 201 handler and subsequent GET has no effect on the bug.
  4. The delay is always 1.1 minutes. I’ve used console.time() to determine that the delay varies within the 65,000ms range.
  5. The delay only appears in this configuration. It does not occur in our development setups, which are slightly simpler.

Unverified assumptions I’m making:

  1. Once Nginx logs a request, the response has been tied up with a bow and sent to the client with a handwritten thank-you note.
  2. This is not a bug in the browsers or in jQuery.

Forgive the painstaking detail, but I’ve done my best to eliminate variables, and at present, I feel safe in saying that the problem is one of the following:

  1. a flaw in the physical structure of the universe
  2. a flaw in the perceptual models of our minds
  3. something else we haven’t considered yet

I’m hoping for #3. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:14:37+00:00Added an answer on June 12, 2026 at 11:14 am

    Mystery solved! It was the Content-Length header, or rather, the lack of one. @MaxDounin had the right idea, I just didn’t follow it far enough.

    Enabling Django’s django.middleware.http.ConditionalGetMiddleware did the trick. (This middleware sets the Content-Length header.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.