Mobile-Detect
Mobile-Detect copied to clipboard
Use cache for isTablet and isMobile
Hey,
I benchmarked one of my pages with blackfire, and noticed that the mobile detector was doing a lot of preg_match. I probably call isMobile() 100+ times.
I think there's also this github issue about the problem: https://github.com/serbanghita/Mobile-Detect/issues/140
This patch leverages the cache property for isMobile()
and isTablet()
calls
Hello ?
I'm not able to perform a review at this time. I'm focused on small patches. I can review this in 2017. Are you using these updates in production?