Verify Your Prerender Integration
Use Chrome DevTools to confirm that Prerender.io is serving prerendered HTML to bots.
Overview
Once you've integrated Prerender.io into your tech stack, it's important to verify that it works as expected—especially for bots. This guide walks you through how to simulate a crawler visit and confirm that your Prerender integration is responding correctly.
We recommend using Google Chrome for this process, though you can adapt the same steps in other browsers with developer tools.
Detailed Explanation / How It Works
The Prerender integration works by detecting bots through their user agent and serving them a static, pre-rendered HTML version of your page. To verify this behavior:
- You simulate a bot visit by changing your browser’s user agent in DevTools.
- You inspect the network response to confirm whether it’s coming from Prerender.
- If correct, the HTML will be static, and the response headers will include
x-prerender-request-id
.
This test ensures proper indexing and SEO performance across search engines.
Step-by-Step Usage
1. Open the Page You Want to Test
Navigate to the URL where you want to confirm your Prerender integration.
2. Open Developer Tools
- Windows: Press
Ctrl + Shift + J
- Mac: Press
Option + ⌘ + J
3. Show Network Conditions Panel
- Windows: Press
Ctrl + Shift + P
- Mac: Press
Command + Shift + P
- Type “Show Network Conditions” and select it
4. Modify the User Agent
- In the Network Conditions tab, uncheck “Use browser default”
- Select Googlebot from the dropdown list
- If your integration uses a custom allowlist, choose a bot included in your config
5. Reload and Inspect the Response
- Refresh the page to simulate a prerendered crawler visit
- Switch to the Network tab in DevTools
- Select the main document (usually the URL you visited)
- Check for the presence of
x-prerender-request-id
in the response headers
How to Know When You’re Done
If you see the x-prerender-request-id
header after simulating a crawler visit, it confirms that Prerender is working correctly, and your site is returning cached HTML to bots.
Once validated, the Prerender Dashboard will show new entries under the CDN Analytics and you’ll be able to access integration-specific menu options.
Note: If the header doesn’t appear immediately, wait a few minutes and refresh—it can take some time for changes to take effect.
Bot Validation Scenario
Some websites use bot validation that blocks requests from simulated bots. If validation fails even after following the above steps, try:
- Adding a custom user agent to your Prerender allowlist
- Selecting a user agent not blocked by your server or CDN
- Using your SEO tool's actual crawler user agent in your test
More details: How to add additional bots
Common Issues and Solutions
Empty HTML Response
If you're getting only:
<html><head></head><body></body></html>
You may be using a framework (like Rails) that blocks I/O when rendering. Use a server that supports non-blocking behavior (e.g., Unicorn, Puma) to avoid render-time deadlocks.
JavaScript Still Showing
If you're seeing JavaScript in the returned page, your Prerender middleware might be running too late. Move the middleware config earlier in your route handling to ensure it runs before other logic.
Partial Page Rendering
Sometimes, your page may begin rendering before all assets load. You can use the window.prerenderReady
flag to delay cache capture until content is ready:
- Add this to your HTML:
<script>window.prerenderReady = false;</script>
- Set it to true when your page is ready (for example after an AJAX call):
window.prerenderReady = true;
This ensures Prerender captures your page only after it has fully loaded.