Latency problem with one browser

Maxim Dounin mdounin at mdounin.ru
Fri Mar 2 18:01:34 UTC 2012


Hello!

On Fri, Mar 02, 2012 at 08:48:43PM +0400, Max wrote:

> 
> 02 марта 2012, 19:53 от Andrea Soracchi <soracchi at netbuilder.it>:
> > Yes,
> > 
> > with "keepalive_disable none;" works fine!
> 
> Maxim, do you think the Playbook browser should be added as a
> separate browser (unsigned playbook:1 entry in ngx_http_headers_in_t)
> to prevent it from getting the Safari keepalive disabled treatment?
> 
> Here's a typical Playbook browser User-Agent string, adding an if
> block for "Playbook" before the "Safari" if block in
> ngx_http_process_user_agent() should do the trick:
> 
> Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) \
> AppleWebKit/534.8+ (KHTML like Gecko) version/0.0.1 Safari/534.8+

Detecting all browsers (thousands of them) which pretend to be 
Safari is not an option.  And, after all, browsers use other's 
product token for reason, and workarounds for bugs is what they 
expect to get as a result.

I'm planning to disable this Safari workaround by default instead, 
the following patch is already sitting in my queue:

# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1330697796 -14400
# Node ID 88e257b4bd3d61e30d1421ab6f2e417a8baedb96
# Parent  277a1822fc5cf7ad83297c74839ca8c84a49680c
Removed safari from keepalive_disable default.

The bug in question is likely already fixed (though unfortunately we have
no information available as Apple's bugtracker isn't open), and the
workaround seems to be too pessimistic for modern versions of Safari
as well as other webkit-based browsers pretending to be Safari.

diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -3568,8 +3568,7 @@ ngx_http_core_merge_loc_conf(ngx_conf_t 
     ngx_conf_merge_bitmask_value(conf->keepalive_disable,
                               prev->keepalive_disable,
                               (NGX_CONF_BITMASK_SET
-                               |NGX_HTTP_KEEPALIVE_DISABLE_MSIE6
-                               |NGX_HTTP_KEEPALIVE_DISABLE_SAFARI));
+                               |NGX_HTTP_KEEPALIVE_DISABLE_MSIE6));
     ngx_conf_merge_uint_value(conf->satisfy, prev->satisfy,
                               NGX_HTTP_SATISFY_ALL);
     ngx_conf_merge_uint_value(conf->if_modified_since, prev->if_modified_since,

Maxim Dounin



More information about the nginx mailing list