Skip to content
  • There are no suggestions because the search field is empty.

How Prerender.io works with CDNs

A CDN is usually the easiest and most reliable place to integrate Prerender.io into your stack.

TL;DR

When your site runs behind a CDN like Cloudflare, Fastly, or Akamai, you can integrate Prerender.io directly at the CDN layer. The CDN detects incoming bot requests by User-Agent, forwards them to Prerender.io, and returns fully rendered HTML to AI crawlers and search engines. Your website visitors are never affected. This is the recommended approach for most CDN-based setups.


Why integrate at the CDN layer

Your CDN sits in front of your origin server and handles every request before it reaches your application. That makes it the ideal place to route bot traffic to Prerender.io.

Integrating at the CDN layer gives you:

  • No changes to your application code or server configuration.
  • Bot requests intercepted before they reach your origin.
  • Rendered HTML returned to AI crawlers and search engines from the edge.

 


How CDN integration works

When an AI crawler or search engine bot visits your site, the CDN checks the incoming User-Agent header. If the request matches a recognized bot, the CDN forwards it to Prerender.io's rendering service at https://service.prerender.io/, passing your Prerender.io token via the x-prerender-token request header.

Prerender.io renders the page and returns clean HTML. The CDN caches that result and serves it on subsequent bot requests.

Your website visitors are never affected. Their requests go through the normal CDN path, unchanged.

⚠️ CDN configuration changes can take a minute or two to take effect. If the integration does not appear to be working immediately, wait before troubleshooting.


Supported CDN integrations

Cloudflare

The Cloudflare integration uses a Cloudflare Worker written in JavaScript. The Worker checks the User-Agent on every incoming request and forwards bot traffic to Prerender.io.

Before you configure the Worker:

  • Cloudflare must be set up as a proxy on your domain. The A or CNAME record for your domain must be in proxy mode (orange cloud enabled).
  • Automatic Signed Exchanges (SXGs) must be disabled in Cloudflare. If SXGs are enabled, Cloudflare may serve your cached rendered pages to website visitors clicking through from search results.

➡️ See the Cloudflare integration guide for full setup instructions.


Fastly

The Fastly integration uses two VCL snippets: one to detect bot requests and one to forward them to Prerender.io. It uses a custom cache key that includes the User-Agent header, which keeps bot caches and website visitor caches separate.

➡️ See the Fastly integration guide for full setup instructions.


Akamai

The Akamai integration detects crawlers using the User-Agent request header. Using Akamai Bot Manager is recommended for more flexible and reliable bot detection.

The integration routes bot requests to https://service.prerender.io/, passes x-prerender-token in the request header, and disables edge caching for bot traffic.

ℹ️ The Akamai integration is community-maintained. For platform-specific support, contact Akamai representative.

➡️ See the Akamai integration guide for full setup instructions.


    Verify your integration

    After configuring your CDN, confirm that Prerender.io is correctly intercepting bot requests.

    ➡️ See Verify your Prerender.io integration for step-by-step instructions.

    ✅ Your integration is working when the x-prerender-requestID header appears in the response headers for bot requests. If the header is missing, the integration is not routing correctly.

    If verification fails, see Why is my CDN serving unrendered content to bots? for troubleshooting steps.


    Related Articles


     

    💬 Still need help? If you have questions about CDN integration or need help configuring Prerender.io with Cloudflare, Fastly, or Akamai, our support team can help. → Contact us at support@prerender.io

     

    Was this article helpful?