Separate Mobile Cache
If your site sends different HTML to phones than to desktops, the cache needs to keep the two versions apart. This guide explains the Separate Mobile Cache setting.
What this does
By default, xSpeed Cache stores one cached copy of each page and serves it to every visitor. That is correct for responsive themes, where the same HTML adapts with CSS on any device.
Some sites instead send different HTML based on the device, for example AMP pages or a dedicated mobile theme. With one shared cache, whichever device loaded the page first would win, and the wrong version could be served to the other device.
When Separate Mobile Cache is on, xSpeed Cache keeps mobile and desktop responses in separate cache buckets. Each device type gets its own cached copy, so neither can overwrite the other.
Why use it
Turn it on when your site serves different HTML by device, such as:
- AMP pages
- A mobile-specific theme like WPtouch or the Jetpack mobile theme
- Any other setup that outputs different markup for phones
If your theme is responsive (the same HTML on all devices), leave this off. You do not need it, and a single shared cache is faster.
Settings explained
| Setting | What it does | Default |
|---|---|---|
| Separate Mobile Cache | Keep mobile and desktop responses in separate cache buckets | Off |
xSpeed Cache detects mobile visitors using the same method WordPress core uses (wp_is_mobile()), so the split lines up with whatever your theme uses to decide what to show.
How to enable it
- Open the xSpeed Cache Cache page in your WordPress admin.
- Find the Separate Mobile Cache setting.
- Switch it on.
- Save your settings.
A note on speed
Note: While Separate Mobile Cache is on, xSpeed Cache turns off the static-file web-server rewrite and serves cached pages through its PHP drop-in instead. The web-server rewrite cannot tell mobile from desktop, so it could serve the wrong version. The PHP path is slightly slower than the direct static path, but it guarantees each device gets the right HTML. This is the right trade-off for sites that truly serve different markup per device, and the reason to leave the setting off when you do not need it.
Best practices
- Only turn this on if your site really sends different HTML to phones.
- Responsive themes do not need it. Leaving it off keeps the faster static-file serving available.
Troubleshooting
- Mobile visitors see the desktop layout (or the reverse). If you serve different HTML per device and this happens, make sure Separate Mobile Cache is on, then purge the cache.
- My site got a little slower after enabling this. That is expected. With the setting on, serving moves to the PHP drop-in path so each device gets correct HTML.
FAQ
Do I need this for a responsive theme? No. Responsive themes send the same HTML to all devices, so one shared cache is correct and faster.
How does xSpeed Cache decide if a visitor is on mobile? It uses WordPress core’s own mobile detection, so it matches how your theme branches.
Related
- How to Enable Page Cache
- Bypassing Cache by User Agent
- Setting Cache Lifetime (TTL)