Open ghost opened 10 years ago
There are 4 arrays needed.
I hope I explaned it right.
Could you tell what kind of browscap file you use (lite, normal or full) ?
What we ended up doing in WP SlimStat [ https://github.com/getusedtoit/wp-slimstat/tree/master/databases ] is to split the initial ini file into 5 chunks, and then run phpbrowscap on each of them to create the corresponding cache.php. Then we simply loop through the files until we find a match. Memory usage went from 20M to 2M!
If you like, create a feature request on https://github.com/browscap/browscap to let you create these splitted files. Then dont need to do this after each update.
The size of browscap.ini has more than doubled in the last few months. Using v5024, the corresponding php cache file needs about 20M of RAM. We are using a stripped down version of that file in our WordPress plugin, wp SlimStat.
I was wondering if there was a way to split the cache into multiple files, and then loop through them to load only a subset of agents/browsers at a time.
Would you be able to explain the structure of _browsers and _patterns and how they work together to see if we can split them correctly?