I recently updated the browscap.ini file on my site, to be able to recognize iOS 8 UAs, and was surprised to find that between the file I downloaded in March (v5024; normal) and the one I downloaded yesterday (v5032; normal), the file size has more than tripled! (2.6 MiB vs. 8 MiB!)
Even the lite edition of v5032 doubles the size of the file (2.6 MiB vs. 5.2 MiB)!
Could someone here help me understand what changes were made to the file over the summer that explains this substantial growth?
I tried looking at diffs but there were simply too many to get a comprehensive understanding of what the major changes were. I also tried looking at the issues and commits in GitHub, but I'm still left scratching my head.
Was there an explosion in new web browsers over the summer?
Thanks for your help,
- Anthony
hi Anthony
It is a great question. We have done numerous improvements to the quality of data contained in the ini. However, the trade off is that the file is now much larger.
We acknowledge that this is a problem in some common cases (including running out of memory parsing the file), and we are trying to take an effective course of action.
Because I do this in spare time, so far I have not time to remedy this, but there are definitely plans to address these issues :)
Hope that helps!
Thanks
James
--
You received this message because you are subscribed to the Google Groups "browscap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to browscap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi James,
Thanks for your prompt reply.
I am thinking an interesting solution to this problem would be to cross-reference browser definitions with their popularity out in the wild, in order to be able to build files which include the most popular browsers.
Rather than (or perhaps in addition to) manually curating a standard and lite version, it would be interesting to be able to build your own definition files on-the-fly. Since usage statistics would be associated with each browser family, one could generate a definitions file to cover the 90th percentile, 95th percentile, 99.9th percentile, etc., possibly manually-including other browser families of interest as well.
e.g.:
`bin/browscap build --percentile=99 --include="BlackBerry 3.7"`
`bin/browscap build --size=3M --include="Safari 5.0" --include="Nagios"`
There would need to be ways of including browsers which aren't common out in the wild, but which are needed, e.g. crawlers.
Thanks for all of your work on this project, it has definitely made UA detection much easier.
- Anthony
Hi Anthony
Indeed - this sort of solution is not unknown to us, and although technically it works fine, in practice there are issues... At the moment, the cost to run the server for the project is minimal, but if we allowed people to generate their own from the website, the processing power required would undoubtedly increase dramatically - and thus the cost of running the servers would become unmanageable for me.
So where does that leave us? Well - the end user could generate their own e.g. using a command similar to the one you have pointed out... But those who are having memory issues will have memory issues still. The memory required to generate the INI in the first place is much higher (mostly, in fact due to the different format generation), so this actually wouldn't solve the problem for those users.
In practice there are such issues, so I think, at least to start with there are two main things we need to change, in order:
- Reduce the size of the "standard" version by removing uncommon properties (like JavaScript, css version etc.) - these I think you'll agree are better detected by something like Modernizr. Lite version should include less UAs too, and we should better manage which UAs are included.
- Improve the browscap-php memory usage much better. No easy feat, and this will require a lot of work, possibly even breaking BC, or requiring a newer PHP version etc.
The reason I list this second is because changing the PHP parser will not help anyone not using PHP... so is actually not that effective. Nevertheless it is something we can work towards as we support that component and it is definitely an issue for many.
Thanks
James
Is there a way to maybe allow someone to generate a file from the website (that cannot be automated to avoid the huge overhead) according to a "last active" date or a "how common" field for the definitions? For example, if there is a last seen date of over 2 years ago, I might want to skip it. Or, if it a really rare (maybe on a scale of 1-10) we can exclude them to a certain level. This MIGHT dramatically reduce the file and should be pretty easy to implement. Just spit-ballin' here! :)
Hey
As this is an open source project that is only run by a tiny handful of people (pretty much 1-2 people), I'm afraid we can't give you an idea. The project is not invested enough to have a roadmap or anything. However, like I said, perhaps instead of going and creating your own version, you help us (and thus everyone) by contributing a change to Browscap that means even lighter files :) that way, you'd be helping your boss, the project and everyone else in the process! if you need help contributing, all you need to do is ask! ;)
Thanks
James