Mobile cache
Keep a separate page cache for visitors on phones, for themes that show different pages on mobile devices.
Parts of this feature are still being built. The Not yet section lists them.
Mobile cache keeps a second copy of each cached page for phones. Desktop visitors keep getting the normal cached page.
When you need it
Most themes send the same page to every device and change the layout with CSS. Those sites do not need mobile cache. Turn it on when your theme or a plugin prints different HTML for phones, usually through WordPress's wp_is_mobile().
Turn it on or off
- Open your site and go to Caching.
- On Edge Caching, find Mobile cache and choose Enable or Disable.
The change is a job. It applies the setting on the server and at the edge, then clears your site's caches. You need the permission to manage edge settings. The card shows only while Edge Caching is enabled.
Who counts as mobile
Avaloi uses the same test as wp_is_mobile(): the Sec-CH-UA-Mobile hint when the browser sends it, and otherwise a User-Agent that contains Mobile, Android, Silk/, Kindle, BlackBerry, Opera Mini, or Opera Mobi.
Limits
- If your theme changes
wp_is_mobile()with a filter, or detects devices its own way, test a phone and a desktop after you turn it on. - Avaloi keys mobile pages apart itself, so it works on the Cloudflare Free plan and uses no shared Cloudflare rules.
- Clearing a URL clears both its desktop and mobile copies.
Not yet
- The Avaloi edge page cache is not switched on for live traffic yet, so mobile cache works on the server page cache only.
- A server whose agent is older than mobile cache keeps one shared page cache, and the job says the server needs an agent update.
API
PUT /v1/environments/{id}/tools/mobile-cachewith{"enabled": true}or{"enabled": false}. Answers 202 with the job.- The environment's
tool_settings.mobile_cacheshows the current setting. - MCP tool:
set_mobile_cache.
Related
Still stuck?
Email [email protected] with your site name and what you tried, or send us a message.