How to test your site after you have successfully validated your Prerender integration
First things first: we recommend using Chrome.
Open your desired URL
Open Dev tools (CTRL+Shift+J on Windows , Option + ⌘ + J on Mac)
Run command (Control + Shift + P on Windows, Command + Shift + P on Mac) - Show Network Conditions
After you have Network Conditions “enabled,” navigate to it, look for “User Agent,” and de-select “Use browser default”.
Select Googlebot from the dropdown list (except if you have modified the pre-defined allow list in your Prerender config, in that case, use a different bot that is allowed in your configuration)
Reload your site
Switch to the Network tab and look for the very first connections header :
If the response contains “x-prerender-requestid” then you can conclude that Prerender.io is working on your site and serving the request.
Are you only getting this?
You are probably on Rails or some other framework that uses blocking I/O. You need to switch to a server (like Unicorn or Puma) that lets you start multiple processes or use non-blocking I/O so that there isn’t a deadlock when Prerender tries to render your page on the fly.
In this case, you view the source of your page that should be prerendered, but it looks the same as a non-prerendered page. This usually happens if your middleware or config isn’t high enough in your code to execute it before some other route. Try moving your Prerender middleware configuration higher in your file to see if you can get the Prerender middleware to execute first.
Is your page only partially rendered?
Our Prerender server tries its best to determine when the page is done loading by counting the number of requests in flight. Once the number of requests in flight reaches zero, we wait a short period of time and then save the HTML. If this saves the page too early, you can use our window.prerenderReady flag to notify the server that your page is ready to be saved.
Put this in your HTML:
<script> window.prerenderReady = false; </script>
When we see
window.prerenderReady set to false, we’ll wait until it’s set to true to save the HTML. Execute this when your page will be ready (usually after ajax calls).
window.prerenderReady = true;