LiteSpeed

LiteSpeed Cache mobile view: when to use a separate mobile cache

When WordPress sites need a separate mobile cache in LiteSpeed Cache, how Cache Mobile works with user-agent lists, and why responsive themes usually do not need it.

IntermediateWordPress on LiteSpeed3 min read

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 siteCache Mobile
Responsive theme, same HTML everywhereOff (default); one cache serves all
Theme or plugin uses wp_is_mobile() to change outputOn
Separate mobile theme pluginOn
Page builder with "hide on mobile" sections done in CSSOff; CSS handles it

Enable Cache Mobile

  1. Go to LiteSpeed Cache → Cache → Cache.
  2. Set Cache Mobile to On.
  3. Review the List of Mobile User Agents. The default list covers common phones; add patterns only if a device is missed.
  4. 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

  1. Open the page on a phone, or in Chrome DevTools device mode with a phone user agent, and reload twice.
  2. Check the response headers for x-litespeed-cache: hit and that the mobile layout appears.
  3. Repeat on desktop and confirm the desktop layout.
  • 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.

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.