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

前端 未结 5 2182
深忆病人
深忆病人 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 08:14

    Some things that might help, in no particular order:

    1. Use asset hosts, they are extremely easy to setup: http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html
    2. Make sure that Javascript is loaded near the bottom of the page, when possible.
    3. Make sure that Apache/Nginx/whatever correctly sets the Expires-In HTTP header.
    4. Run Google Speed Page under Firefox, this will provide lots of good info.

提交回复
热议问题