Mobile user agents for Cache Mobile feature




Wordpress LScache Plugin: Mobile user agents for Cache Mobile feature

Last Updated on: Wed, 15 Apr 2026 00:00:02
Im using Mobile Detect (https://github.com/serbanghita/Mobile-Detect) in my child theme and it works perfectly fine. However, when I enable LiteSpeed Cache ? tablet users get the mobile cache version. I enabled Cache Mobile feature, but I believe LS relies on the List of Mobile User Agents option and the default list covers a wide range of mobiles and tablets. Id like to reuse the list of UAa from Mobile Detect (https://github.com/serbanghita/Mobile-Detect/blob/5.x/Mobile_Detect.php#L359) but can I use regexps in List of Mobile User Agents ? Looks like I cant. The idea behind detecting mobile devices is not bad, bad not fail save, because it uses only device names in UA, but the detection is only as good as the database about available devices is currently. In most cases this is not the case. Device names changes almost weekly. But there is a simple way to detect and to differentate mobile devices and smartphones from tablet devices. The question is do you have a theme that do that as well? @CacheCrawler In this particular case, I use Blocksy theme. Whats the simple way you mentioned? I thought about injecting JS to add/remove things based on screen width, is that what you mean? LSCWP uses is_mobile() from wordpress built-in function , and WP will take ( lots if not all) tablet as mobile , a 3rd party detection plugin could be more detailed and accurate, but this will confuse LSCWP. I dont really have a good solution for this case, I will bring it to our developers and see if they can come up with something I dont really have a good solution for this case, I will bring it to our developers and see if they can come up with something This is how Google does it (and me): https://developer.chrome.com/docs/multidevice/user-agent/ Whats the simple way you mentioned? I thought about injecting JS to add/remove things based on screen width, is that what you mean? No, see link in last post.



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference