Wordpress LScache Plugin: mobile only and desktop only not working
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hi I use the function wp_is_mobile() , in my functions.php to create the shortcodes desktoponly and mobileonly . The code seems to work, BUT, after some time the code suddenly stops working? (i.e. I see desktop info on my mobile page?.) I then edit the page and resave, without actually changing anything. hey presto, the shortcode starts working again? Im suspecting this has something to do with Litespeed..? Does this sound likely, and how should I debug this..? thanks, Bruce The page I need help with: https://www.watersportswarehouse.co.za/ Hi, There is an option , cache mobile , did you enable it ? Best regards, no I havent, because Ive got a responsive site, and they say not to for responsive sites?? Hi, For responsive site , yes , but you have a custom function in case of responsive theme , one cache is good for both desktop and mobile when cache mobile enabled , it will have 2 caches , one for desktop , one for mobile. or , if that is a shortcode , you can try make it ESI block. Best regards, If there is only 1 cache, then probably my main desktop page is cached, and it doesnt matter whether a mobile phone or a desktop computer requests the home page, the cached copy gets sent. (Together with desktop content) I dont know too much on ESI codes, but I have looked a bit on your site? I see how If I make a widget uncached this would work? However, Im using a shortcode, that I inset into my page with Gutenberg For example [mobileonly] mobile only content [/mobileonly] How do I turn these 3 lines into a ESI block..? Is it simply.. [esi mobileonly] mobile content [esi /mobileonly] do I need to add TLL Will this work and solve my issues? cheers, Bruce Hi, If there is only 1 cache, then probably my main desktop page is cached, and it doesnt matter whether a mobile phone or a desktop computer requests the home page, the cached copy gets sent. (Together with desktop content) Well , I would guess which one comes first, which one gets cached. your shortcode is bit of unusual in this case, I think it may not work , but you can give it a try [esi mobileonly ttl= 0 ] [esi /mobileonly ttl= 0 ] otherwise better to use cache mobile. Best regards, The ESI code does not work at all? Caching mobile seems to work though. Please confirm there are no issues around caching mobile on my responsive site? (I worry ignoring the message that they say not to enable n responsive sites?)( cheers, Bruce Hi, Well , technically there is no issue , the only adverse effect is possibly just using a little bit of more disk spaces Best regards,
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference