Why do some page requests hang when fetching Javascript/image assets using Safari and Apache 2.2.3?

前端 未结 5 2183
深忆病人
深忆病人 2021-02-10 07:56

Some of the users of our Ruby on Rails app have complained that page requests occasionally hang indefinitely under Safari (a couple have noticed it under Firefox, but it\'s over

5条回答
  •  感动是毒
    2021-02-10 07:58

    Olly,

    This may or may not be related, but browsers have a limit of 2 (by default) simultaneous connections that they can make. If there are connections kept open for communication, and you are also fetching images, the call to the image may not go through till the browser has one of its stipulated connections free. The hang during image fetch may actually be triggered by some other server connections which are not completing or are being held open by the server and browser. So you may actually be hunting in the wrong place.

    If you are able to reproduce the error, try switching to HTTP 1.0 on your dev server and see if it fixes the issue. Also try moving some of the assets to another domain/subdomain and fetch from there.

    Hope that gives you another angle.

    Regards, Narayan

提交回复
热议问题