![]() |
Is it possible litespeed has a problem with mobile safari ?
I could be wrong but I am seeing strange, much longer page load times on mobile Safari from an iphone when connecting to litespeed 4.0.x
There are some subtle differences in Safari on iphone. Perhaps there is a timeout issue. Does anyone have an easy way to test the same content from apache vs litespeed off their iphone? I don't want to start "pointing fingers" until I have more data. I know Chrome on Android is not experiencing any problems and it's also webkit based but there are definitely core differences between the two browsers. |
You can try "tcpdump" on server side.
First, find out the IP of your iPhone. Then run command tcpdump -s0 -X host <ip_of_your_iphone> think it is just the poor AT&T wireless network. ;) |
If you don't mind I am going to PM you with some charts.
|
I turned off "smart keep alive" just to see if it makes any difference.
I am seeing roughly a 50% speed improvement, but it make be a fluke of course. I will repeat the test late night on a weekend to see if super low traffic on their networks makes a difference. |
I think I found the problem, maybe, mobile Safari is being picky.
LiteSpeed sends a Connection: Keep-Alive when the source is php output and does not allow php to override? However the last thing I send on the page is a tracking gif, which I send as embedded packed hex, with header('Content-Type: image/gif') Content-Length: 43 and most importantly header('Connection: close') The Connection: close is being removed/overwritten by litespeed with keep-alive, so safari keeps waiting for up to 5 seconds before it times out (or litespeed does). How can I force litespeed to close the connection from php when I want it to? (note that other browsers do not seem to have this problem so I am not blaming litespeed) Code:
HTTP/1.1 200 OK |
you can turn off keepalive with rewrite rule, like
RewriteCond %{HTTP_USER_AGENT} iphone_user_agent_signature RewriteRule . - [E=nokeepalive:1] |
Oh excellent!
That is exactly the solution I was hoping for, based on useragent. I wasn't aware litespeed could toggle things like keep-alive through htaccess I will have to look for the docs. OH! I see it's actually from apache. I never knew that directive! But it's also over here http://store.litespeedtech.com/store...yarticle&id=21 |
Sadly this does not seem to be working.
Keep-Alive is still being sent Even took out the condition and just tried by itself RewriteRule . - [E=nokeepalive:1] maybe it has to do with sending a different kind of Content-Type header from PHP which is making litespeed ignore it? I'll try it on a plain PHP page. |
Are you sure rewrite is properly enabled? maybe enable rewrite log.
|
A little later I am going to create a minimal testing environment to see what exactly is happening.
By the way, I don't suppose PUTENV can be used within PHP to send the same command? http://php.net/manual/en/function.putenv.php ie. putenv("nokeepalive:1") or maybe putenv("nokeepalive=1") not sure even apache will obey that. |
| All times are GMT -7. The time now is 01:54 AM. |