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
wwwwith 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:
1Type: CNAME
2Name: www
3Value: customers.prerenderbuddy.comUse 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_KEYas 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.
1PRERENDER_BUDDY_API_KEY=your_site_api_keyDo not use:
1VITE_PRERENDER_BUDDY_API_KEY
2NEXT_PUBLIC_PRERENDER_BUDDY_API_KEY
3PUBLIC_PRERENDER_BUDDY_API_KEYThose names are intended for browser-exposed variables in many frontend stacks.
Worker routing rules
A Worker integration should:
- Run only for public page requests.
- Skip assets, API routes, images, fonts, JSON, XML, TXT, and sourcemaps.
- Detect crawler User-Agent strings.
- Call Prerender Buddy's render API with a server-side key.
- Return rendered HTML to crawlers.
- Let normal visitors continue to the original site.
Root vs www handling
Root and www are separate hostnames.
1example.com
2www.example.comIf www.example.com is protected and the root domain should redirect to it, create a Cloudflare Redirect Rule:
1If hostname equals example.com
2Redirect to https://www.example.com${uri.path}
3Status code: 301
4Preserve query string: yesThis prevents crawlers from hitting an unprotected root domain and receiving the original app shell.
How to verify
- Deploy the DNS or Worker change.
- Open the site in Prerender Buddy.
- Click Refresh status if using DNS setup.
- Click Verify Installation.
- Test the exact hostname you configured.
- Check the Logs tab for a crawler request.
For managed DNS setup, successful crawler responses often include:
1x-prerender-cache
2x-prerender-cache-ttl
3x-prerender-timeWhat 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
wwwbut 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
wwwis the protected hostname - redirecting every root path to the homepage instead of preserving the path
Related docs
Related free tools
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.