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

前端 未结 5 2181
深忆病人
深忆病人 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:09

    I know this is an old topic, but I wanted to share a solution for Safari that might save others some time. The following line really solved all problems:

    BrowserMatch "^(?=.*Safari)(?=.*Macintosh)(?!.*Chrom).*" nokeepalive gzip-only-text/html
    

    The regex makes sure only Safari on Mac is detected, and not Mobile Safari and Chrome(ium) and such. Safari for Windows is also not matched, but the keepalive problem seems to be a Mac-Safari combination only. In addition, some Safari versions do not handle gzipped css/js well.

    All our symptoms of our site crashing or CSS not completley loading in different versions of Safari which caused me to nearly pull my hair out (Safari really is the new IE) have been solved for us with this Apache 'configuration hack'.

提交回复
热议问题