Most modern themes are responsive: the same HTML adapts to every screen with CSS. Some themes and plugins, though, send different HTML to phones, such as a separate mobile menu or AMP-like layout. If such a site caches only one version, mobile visitors can get the desktop page or the other way round. LiteSpeed Cache's Cache Mobile setting solves this.
Before you start
- LiteSpeed Cache installed and working (see configuring LiteSpeed Cache).
- Know whether your theme serves different HTML on mobile. Ask the theme developer, or compare the page source on a phone and desktop.
Do you need it?
| Your site | Cache Mobile |
|---|---|
| Responsive theme, same HTML everywhere | Off (default); one cache serves all |
Theme or plugin uses wp_is_mobile() to change output | On |
| Separate mobile theme plugin | On |
| Page builder with "hide on mobile" sections done in CSS | Off; CSS handles it |
Enable Cache Mobile
- Go to LiteSpeed Cache → Cache → Cache.
- Set Cache Mobile to On.
- Review the List of Mobile User Agents. The default list covers common phones; add patterns only if a device is missed.
- Save and click Purge All.
LiteSpeed now keeps two cached copies of each page: one for mobile user agents and one for others.
Note: A separate mobile cache doubles the number of cached pages, which uses more disk and makes the cache warm up slower. Only enable it when your HTML really differs.
Test it
- Open the page on a phone, or in Chrome DevTools device mode with a phone user agent, and reload twice.
- Check the response headers for
x-litespeed-cache: hitand that the mobile layout appears. - Repeat on desktop and confirm the desktop layout.
Related settings
- Guest Mode serves the default variation on the very first view, which matters for sites with separate mobile HTML (see Guest Mode).
- If you use a CDN that caches HTML, make sure it also varies by device, or keep HTML caching on the server only (see LiteSpeed Cache with Cloudflare).
Troubleshooting
Phones still get the desktop page
The page was cached before Cache Mobile was enabled. Purge All, then test again. Check the device's user agent is matched by the list.
Tablets get the wrong layout
Decide whether tablets should be "mobile" for your theme, then add or remove tablet patterns in the user agent list.
Frequently asked questions
Does Google care about separate mobile caching?
Google uses mobile-first indexing; what matters is that the mobile crawler gets the correct mobile page, which Cache Mobile ensures for sites with different HTML.
Is AMP affected?
AMP pages have their own URLs, so they are cached separately anyway.
How do I know if my theme uses wp_is_mobile()?
Search the theme and plugin code for wp_is_mobile, or ask the developer. If the page source on a phone differs from desktop, you need Cache Mobile.
Does Cache Mobile affect the crawler?
Yes, the LiteSpeed crawler can warm both versions; enable the mobile crawler option only if you use Cache Mobile.
