No-code DNS setup

Cloudflare setup

Use DNS setup, redirect rules, or a Worker depending on your routing needs.

Cloudflare setup

Use this guide when Cloudflare manages DNS, redirects, or Workers for the website you want to protect.

Cloudflare can be used with Prerender Buddy in two different ways: no-code DNS setup or developer Worker setup.

What this guide helps with

  • deciding whether to use DNS setup or a Worker
  • routing crawler requests before the JavaScript app shell is returned
  • keeping API keys server-side
  • handling root vs www with Cloudflare Redirect Rules
  • verifying crawler requests reach Prerender Buddy

When to use no-code DNS setup

Use no-code DNS setup when:

  • you can point the public hostname to Prerender Buddy
  • the site is a hosted builder, static app, React/Vite/Vue SPA, or simple marketing site
  • you do not want to maintain Worker code
  • you have a separate origin URL where the normal site still loads

For www setup, the DNS record usually looks like:

DNS record
1Type:  CNAME
2Name:  www
3Value: customers.prerenderbuddy.com

Use the original host as the Current website location. That might be a Lovable, Netlify, Vercel, Pages, or other provider URL.

When to use developer setup

Use a Cloudflare Worker when:

  • DNS must stay pointed at the current site
  • you want custom request handling
  • the site can run code before HTML is returned
  • you can store PRERENDER_BUDDY_API_KEY as a Worker secret

The Worker must run before the app shell is returned. Adding crawler logic inside React, Vue, or browser JavaScript is too late because the crawler has already received the thin HTML.

API key storage

Store the key as a Cloudflare Worker secret.

Environment variable
1PRERENDER_BUDDY_API_KEY=your_site_api_key

Do not use:

Environment variable
1VITE_PRERENDER_BUDDY_API_KEY
2NEXT_PUBLIC_PRERENDER_BUDDY_API_KEY
3PUBLIC_PRERENDER_BUDDY_API_KEY

Those names are intended for browser-exposed variables in many frontend stacks.

Worker routing rules

A Worker integration should:

  1. Run only for public page requests.
  2. Skip assets, API routes, images, fonts, JSON, XML, TXT, and sourcemaps.
  3. Detect crawler User-Agent strings.
  4. Call Prerender Buddy's render API with a server-side key.
  5. Return rendered HTML to crawlers.
  6. Let normal visitors continue to the original site.

Root vs www handling

Root and www are separate hostnames.

Example
1example.com
2www.example.com

If www.example.com is protected and the root domain should redirect to it, create a Cloudflare Redirect Rule:

Example
1If hostname equals example.com
2Redirect to https://www.example.com${uri.path}
3Status code: 301
4Preserve query string: yes

This prevents crawlers from hitting an unprotected root domain and receiving the original app shell.

How to verify

  1. Deploy the DNS or Worker change.
  2. Open the site in Prerender Buddy.
  3. Click Refresh status if using DNS setup.
  4. Click Verify Installation.
  5. Test the exact hostname you configured.
  6. Check the Logs tab for a crawler request.

For managed DNS setup, successful crawler responses often include:

Example
1x-prerender-cache
2x-prerender-cache-ttl
3x-prerender-time

What success looks like

  • DNS or Worker routing is active.
  • Verify Installation says the integration is connected.
  • Crawler requests appear in logs.
  • Googlebot-style requests receive real headings, copy, metadata, and links.
  • Normal visitors still load the original website experience.

Common mistakes

  • protecting www but leaving the root domain pointed at the original app
  • adding Worker code but not deploying it to the production route
  • storing the API key in frontend code or a public environment variable
  • running crawler detection inside browser JavaScript
  • testing the root domain when www is the protected hostname
  • redirecting every root path to the homepage instead of preserving the path

Ready to check the setup?

After DNS or middleware is deployed, use Verify Installation from the site dashboard and check the logs tab for crawler requests.

Still stuck? Email support@prerenderbuddy.com.

Open dashboard