How to test that your prerender setup works: fetch the page as a crawler and read the HTML
To check that your prerender setup works, request the page with a crawler's user agent and read the raw HTML that comes back. The prerender-node README says that with your browser's user agent set to Googlebot's, View Source should show "the static HTML version of the page". If you still see script tags, the README says the middleware isn't set up properly yet.
The catch: your normal browser visit won't show you any of this. The middleware checks the user agent string to decide whether a request comes from a crawler, so you have to send a crawler's user agent. Below are three ways to run the check, and what to look at first when it fails.
What the middleware does with a request
Before you test, it helps to know which gates a request passes through. The prerender-node README lists them:
- It checks whether the request comes from a crawler by checking the user agent string against a default list of crawler user agents.
- It checks that you aren't requesting a resource (js, css, etc...).
- Optionally, it checks that the URL is in your whitelist, and that it isn't in your blacklist.
- It makes a GET request to the prerender service for the page's prerendered HTML.
- It returns that HTML to the crawler from your server.
So your test request has to get past every gate. Ask for a page, not an asset. Use a user agent the crawler list actually matches. If you set a whitelist or a blacklist, pick a path the list lets through. Miss any of these and your test tells you nothing about the prerender service.
Google describes the same pattern for dynamic rendering in general: it requires your web server to detect crawlers, for example by checking the user agent, and to route those requests to a rendering server.
Fetch the page as a crawler from the command line
This is the quickest check, with no browser in the way. curl's -A option lets you specify the User-Agent string to send to the HTTP server. If the string has spaces, the curl manual says to surround it with single or double quote marks. Without the option, curl uses its own user agent, curl/VERSION.
PAGE_URL="<a page on your site>"
curl -A "Googlebot" "$PAGE_URL" > as-crawler.html
curl "$PAGE_URL" > as-visitor.html
# headers only, as a crawler
curl -I -A "Googlebot" "$PAGE_URL"Swap "Googlebot" for whichever crawler you care about, as long as your middleware's list matches it. Then open both files side by side:
- as-crawler.html should be the static HTML version of the page. If it still has your script tags, the middleware isn't set up properly yet.
- as-visitor.html is your normal response.
- If the two files are the same, go to the failure checks below.
- Run the -I line too. curl's -I option fetches the headers only, so you can read what a crawler gets back without the whole body.
Check the status code even when the body looks right. Google's dynamic rendering guide warns that while you're setting up dynamic rendering, your site may produce error pages.
Check it in Chrome with a crawler user agent
If you'd rather stay in the browser, Prerender.io's verification guide gives steps for Chrome DevTools:
- Open DevTools on the page, then open the Network Conditions panel.
- Uncheck Use browser default, then select Googlebot from the dropdown.
- Refresh the page, open the Network tab in DevTools and select the main document request (the URL you visited).
- Read that request's response, not what's drawn on screen.
Here's the bit that's easy to miss: read View Source or the document's response body. Google's help page on rendered source says the plain source typically shows only the original page code returned to the browser. That original code is exactly what you want to inspect here.
Check what Google itself got
For the URL Inspection tool in Search Console and for the Rich Results Test, Google's help page says the HTML tab shows the rendered HTML for the page. For the Rich Results Test, the page must be available to Google without a login, and not blocked by robots.txt.
Keep in mind that this tab shows rendered HTML. Don't treat a complete page there as proof that the prerender service served it. Treat it as the final check after the curl test passes, not a replacement for it.
When the test fails: what to check first
If the crawler response still has script tags and no page text, work through these in order.
- The user agent isn't on the list. The middleware checks the user agent against a default list of crawler user agents, so test with one that's on it.
- You asked for the wrong thing. The middleware checks that you aren't requesting a resource (js, css, etc...), and it checks your whitelist and blacklist if you set them.
- You're testing on localhost. The README says that when testing locally, you need to run the prerender server locally so that it has access to your server.
- The middleware points at the wrong service. PRERENDER_SERVICE_URL is what points the middleware at your service, so check it's set where the request is actually served, not only on your machine.
If you use RenderSwap, which we make at Bright Labs, run the same curl comparison against your site.
A short checklist to keep
- Request a page URL with a crawler user agent your middleware matches.
- Read the raw response: the static HTML version of the page, script tags gone.
- Compare it with the same request using a normal user agent.
- Check the status code with a headers-only request.
- Confirm in the URL Inspection tool's HTML tab once the raw check passes.
Sources
- prerender-node middleware README on GitHub
- Google Search Console help on viewing rendered source
- Google Search Central guide to dynamic rendering
- curl command-line manual page
- Prerender.io guide to verifying an integration
Questions
Why does my page look fine in the browser when crawlers get an empty shell?
Because the middleware decides by user agent. prerender-node checks whether a request comes from a crawler by checking the user agent string against a default list of crawler user agents. To see what a crawler gets, send a crawler user agent with curl -A or with Chrome's Network Conditions panel.
Should the prerendered HTML still contain script tags?
No. The prerender-node README says View Source on a prerendered page should show the static HTML version of the page. If you still see script tags, it says the middleware isn't set up properly yet.
Can I test prerendering on localhost?
Yes, but the prerender server has to reach your server. The prerender-node README says that when testing locally you need to run the prerender server locally so that it has access to your server.
Is the URL Inspection tool enough to prove prerendering works?
It's a good final check, but don't lean on it alone. Google's help page says its HTML tab shows the rendered HTML for the page. Run the raw crawler request first, then confirm in Search Console.
Related
- How to make prerender-node serve AI crawlers: check the list, add the missing bots, test it
- Prerender.io alternative pricing in 2026: what renders cost and what to compare before you switch
- How to point prerender-node at a different prerender service: the service URL and the token
- Can Google see your React content? How to check with the URL Inspection tool