Use Case 1: server-side render all traffic#

  • Implementation 1: forward all traffic to
    • This is the default implementation of our libraries and so has a 5 minute cache to help mitigate the time cost of pre-rendering a request
  • Implementation 2: forward all traffic to but use a local cache
    • This is the recommended implementation because it's quick to implement and high performance (because you're not adding the round trip cost to to 100% of your requests), and easy to do with our Node middleware but more involved for Apache, Nginx, and others
  • Implementation 3: build all HTML in a batch process instead of forwarding traffic to
    • This is the most cost effective and performant implementation but the most challenging.
      • use implementation 2 and crawl the pages with a user-agent that would trigger the prerender
      • or curl > my-prerendered-page.html

Use Case 2: server-side render bot traffic only#

  • Same as use case 1 but restricted to certain user-agents (not recommended due to potential cloaking penalties and the fact that HTTP caches become low value since user-agents are high cardinality)

Use Case 3: Scrape meta or open graph tags of a JavaScript app#

  • Use any HTTP library in any language to do something like:

    const fetch = require("fetch").fetchUrl;
    const fs = require("fs");
    const cheerio = require("cheerio");
    const urlsToParse = [""];
    const options = {
      headers: {
        // put your token here or you'll be rate limited
        "x-prerender-token": ""
    function fetchUrl(url) {
      return new Promise(function(res, rej) {
          (error, meta, body) => {
            if (error) {
              console.error("error fetching", url, error);
              return null;
            let parsed = cheerio.load(body.toString());
            return res([url, parsed("meta").toArray().map(m => m.attribs)]);
    Promise.all( => {
      fs.writeFile("urlsMeta.json", JSON.stringify(urls));

Use Case 4: convert any URL to a PNG or PDF (screenshots)#

See our quick start on converting a URL to a PNG or PDF