Skip to content

Device detector cache #14585

@tsteur

Description

@tsteur

@sgiehl how hard would it be to have a cache for say the top 20 or top 30 most commonly used user agents? Like an array say

$cache = array(
 'Mac Foo' => array('isBot' => false, 'OS' => 'Mac', ... ), 
);

We could every other month update the list of most commonly used user agents. This would avoid needing to parse and test a lot of regexp etc. We could then just test like if (isset($cache[$userAgent])). I think I looked up a while ago that the top 10 or top 30 user agents make up like 50% of the requests which means it would make them a lot faster.

We're sometimes seeing device detector can take 200-400ms "randomly" and maybe it would improve things. I'd be keen to move this to 3.11 if it's easy to do and we could have a look at it. If it's a bit more work, happy to move it into a different milestone.

fyi @mattab

Metadata

Metadata

Assignees

Labels

c: PerformanceFor when we could improve the performance / speed of Matomo.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions