Getting started

The Prerender.io middleware that you install on your server will check each request to see if it's a request from a crawler. If it is a request from a crawler, the middleware will send a request to Prerender.io for the static HTML of that page. If not, the request will continue on to your normal server routes. The crawler never knows that you are using Prerender.io since the response always goes through your server.

We currently have middleware written in these languages/frameworks:

Prerender.io officially maintained middleware:

Community maintained middleware:

After installing the middleware, test locally by downloading our open source Prerender server:

shell git clone https://github.com/prerender/prerender.git
cd prerender
npm install
node server.js

The default port is 3000. Change the server port with export PORT=1337 if needed.

Now you should have a Prerender server running and you should be able to go to http://localhost:3000/https://www.google.com/ and see the Google homepage.

Try switching out Google's URL with your own! Relative links returned in your HTML (like css) don't display correctly here, but will be fine once proxied through your server.

Even better...try switching out your local Prerender server URL with our hosted service! https://service.prerender.io/

Testing your middleware:

Make sure to set your middleware's prerenderServiceUrl to point to http://localhost:3000/ instead of our hosted service. To see a prerendered page exactly how the crawlers will see it, you can set your User Agent in your browser to Googlebot and visit your URL, or run this on a command line and change www.example.com to your URL:

shell curl -A Googlebot https://www.example.com/

If you have your middleware set up correctly, you should see your page returned! You'll know it's correct if you view the source of your page and see all of the HTML in there instead of just the JavaScript. If you aren't seeing your page rendered correctly... see our FAQ, email us at support@prerender.io, or tweet us at @prerender!

That's it! Don't forget to add your Prerender Token to your middleware and push it to a staging server so you can test it with our hosted service.