How Does Prerender Work With CDNs Like Cloudflare, Fastly, or Akamai?

Content Delivery Networks (CDNs) are widely used to improve user experience by improving loading times for global visitors regardless of their distance from your data center.

If possible, the best practice is to integrate Prerender into the CDN to avoid possible routing issues. This is usually the easiest way to integrate Prerender into your system to improve your indexing rate, so if you are using Cloudflare, Fastly, or Akamai CDN, we suggest integrating Prerender into them.

CDN Integrations with Prerender

The integration must detect if a request is coming from a search bot and then forward the request to our service with the Prerender token as a header. We have integration guides with each one of the CDNs mentioned above.

You can find them at the following links:

  • Further Reading: Fastly integration guide
    • It involves two VCL snippets, one for detecting the bots and the other for forwarding the request to Prerender.
    • This integration uses a custom cache key 
  • Further Reading: Cloudflare integration guide
    • It uses a Cloudflare worker with JavaScript syntax
    • It required Cloudflare to be used as a proxy on the domain
    • Disable Automatic Signed Exchange (SXGs) in Cloudflare
  • Further Reading: Akamai integration guide
    • It uses a Criteria

Note: it might take a minute or two for the settings to take effect with CDNs. However, once it is done, you should be able to check if your integration works based on this guide