Getting started

The 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 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 since the response always goes through your server.

We currently have middleware written in these languages/frameworks: officially maintained middleware:

Community maintained middleware:

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

shell git clone
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/ 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.

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 to your URL:

shell curl -A Googlebot

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 or get in touch with us over this link!

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.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.