發現谷歌浏覽器即使pushlet前端傳參使用長連結 stream 模式,但還是實際上效果還是長輪詢模式,但ie、火狐上都是正常的長連結模式
然後在pushlet.properties 中有這樣兩個配置
# You may force all clients to use pull mode
# for scalability
listen.force.pull.all=false
#
# Comma-separated list of User Agent substrings.
# Force these browsers to use pull mode, since they
# don't support JS streaming, matching is done using
# String.indexOf() with lowercased agent strings
# use multiple criteria with &.
#
listen.force.pull.agents=safari
listen.force.pull.all是強制所有浏覽器使用pull模式,這裡需要設為false(預設false)
listen.force.pull.agents浏覽器标志中帶這個參數(不區分大小寫)的強制使用pull模式,改成無,這樣在google浏覽器上也能使用長連結模式了。
listen.force.pull.agents=無