How do I serve mobile and desktop versions of my site to AI crawlers and search enginese?
Overview
Prerender can return a mobile or desktop version of any page to AI crawlers and search engines based on the X-Prerender-Device-Type header you send. Turn on Mobile optimized rendering in your Prerender dashboard, then set the header to Mobile or Desktop on each request to https://service.prerender.ioThe header is case-insensitive.
Why this matters
AI crawlers and search engines increasingly evaluate the mobile version of your site when deciding what to cite, rank, or index. If your site serves substantially different HTML, content, or layout to mobile and desktop visitors, you need a way to give crawlers the version that matches the device they're representing.
Mobile optimized rendering tells Prerender which variant to pre-render and cache. Without it, crawlers may receive the wrong variant — and your mobile pages may not be indexed accurately, or only partially.
Step 1: Turn on mobile optimized rendering in your Prerender dashboard
Open your Prerender dashboard and go to Settings → Advanced Settings. Toggle Mobile optimized rendering on.
This setting tells Prerender to keep separate cached versions of each URL — one for mobile, one for desktop — instead of a single shared cache.

⚠️ If this setting is off, the X-Prerender-Device-Type header is ignored and Prerender returns the same cached HTML to every request — regardless of device
Step 2 : Decide how your integration will set the header
Your integration layer (CDN worker, server middleware, or reverse proxy) needs to read the incoming request, detect whether it's a mobile or desktop user agent, and add the matching X-Prerender-Device-Type header before forwarding to https://service.prerender.io
Most teams already do this device detection somewhere in the stack — for routing, analytics, or responsive serving. Reuse that logic if you can.
ℹ️ Not sure where to add the header in your setup? Ask Nexus, your AI integration assistant inside your dashboard — describe your stack and it will walk you through the right place to inject the header.
Step 3: Add the X-Prerender-Device-Type header to your requests
When your integration forwards a crawler request to Prerender, include the header with one of two values.
For mobile:
X-Prerender-Device-Type: Mobile
For desktop:
X-Prerender-Device-Type: Desktop
The header value is case-insensitive — mobile, MOBILE, and Mobile all work — but stick to one style across your integration to keep logs readable.
Step 4: Verify your integration is returning the right version
Trigger a render for one of your URLs with each header value and confirm Prerender returns the expected variant.
Run a request with X-Prerender-Device-Type: Mobile, then run the same URL with X-Prerender-Device-Type: Desktop. Inspect the returned HTML — viewport meta tags, layout markup, and any device-specific content should differ between the two responses.
You can also check your Prerender dashboard cache view: a URL with mobile optimized rendering enabled should show two cached entries per URL once both variants have been requested.
✅ Your setup is working when the same URL returns distinct mobile and desktop HTML based on the header value, and both variants appear in your cache.
If the responses are identical, see Troubleshooting cached pages — the most common cause is the setting being off, or the header not reaching Prerender because of a CDN strip.
Things to keep in mind
Mobile pages are often lighter than desktop — fewer scripts, smaller payloads, simplified layouts. Serving the mobile version to mobile crawlers keeps Prerender's render times and cache sizes aligned with what those crawlers actually need.
If your mobile and desktop HTML is identical, you don't need this setting. Mobile optimized rendering only earns its keep when the two variants diverge meaningfully — different content, different structure, or different metadata.
The header works in both standard crawler-forwarded requests and direct API calls to service.prerender.io, so you can use the same approach across integrations.
Related articles
- Desktop vs. mobile rendering
- How to cache specific URLs
- How to use Prerender's sitemap crawler
- What to do if some elements are not loaded on the page
💬 Still need help? If you have questions about device-specific rendering or the X-Prerender-Device-Type header, our support team can help. → Contact us at support@prerender.io