1

Due to the NSURLRequest timeout issue in iOS 8 and above, I had to turn off keep alive in my apache server. I read about this https://stackoverflow.com/a/25996971/3162662 on how to set the BrowserMatch and I did it like this in httpd.conf:

<IfModule setenvif_module>
  BrowserMatch "iOS 8\." nokeepalive
</IfModule>

But I wonder if this only applies to iOS 8? What about iOS 9? How can I match all requests from iOS?

Thanks!

Community
  • 1
  • 1
user3162662
  • 743
  • 1
  • 7
  • 20

1 Answers1

2

According to this table os Safari user agents, it seems that you could target by device like this:

BrowserMatch "iPhone" nokeepalive #All iPhones
BrowserMatch "iPhone|iPad|iPod" nokeepalive #All iPhones, iPads and iPods

If you want to target a specific system version, I would go for something like that:

BrowserMatch "iPhone.*OS\s8" nokeepalive #All iPhones on iOS 8
BrowserMatch "iPhone.*(OS\s8|OS\s9)" nokeepalive #All iPhones on iOS 8

I've quickly checked Chrome and Firefox for iOS user agents and it looks like the same regex would work. Of course all this needs some testing.

Simon
  • 3,580
  • 2
  • 23
  • 24
  • thanks but I am making network request programatically using NSURLSession. I am guessing I should target "CFNetwork" ? according to here http://stackoverflow.com/a/18406586/3162662 – user3162662 Dec 15 '15 at 17:44
  • 1
    Sorry I didn't see that you were doing your requests programmatically. I have checked on the logs of some apps we have and I see different user agents. I think that your best option may be to check your Apache's access logs to see what is used by you app. – Simon Dec 15 '15 at 18:12