- Print
- DarkLight
- PDF
Cloudflare Integration for ESM Syntax
This integration is for the ESM javascript syntax in CloudFlare workers. Follow this guide below to integrate Prerender with Cloudflare.
If you keep the SXGs option enabled, Cloudflare will display the cached version of your website pages to users who click on the page link on the search engine result pages.
However, keep in mind that Prerender is meant to create a static HTML file for search bots, so the rendered version may not be as responsive.
To avoid this issue we highly recommend disabling this setting in Cloudflare.
You can turn off Automatic Signed Exchanges by going to Speed -> Optimization -> Other (tab) in Cloudflare settings.
Video guide:
Copy the Cloudflare worker's source code from this link from here.
Text guide:
1. Open your Cloudflare Dashboard and click on Workers & Pages on the left side
2. Click on Create on the Worker overview page
Then click on the Create worker button
3. Give your worker a name.
4. Click on the Deploy button at the bottom right.
5. Click on Edit code
6. Replace the example code with the worker's source code
# Copy the Cloudflare worker's source code from this link.
7. Click on Deploy
8. Step back to the previous interface by clicking on the name of your worker on the top left.
9. Click on Settings
10. Next to the Domains & Routes, click on +Add
11. Select Route
12. Type in your domain like this: *example.com/* and Select the Zone where your site is.
13. Click on Add route
14. Next to Variables and Secrets, click on +Add
15. Copy your Prerender token from your dashboard
Add your Prerender.io Token from the Security and Access menu.