Deploy your Prerender worker on Cloudflare

Cloudflare dashboard

  1. 1. Click on Workers & Pages on the left side

    amdhjsgfaskjdfgv

    Click on Workers & Pages on the left side
  2. 2. Click on Create Worker

    Click on Create Worker
  3. 3. Give your worker a name.

    Give your worker a name.
  4. 4. Click on the Deploy button at the bottom right.

    Click on the Deploy button at the bottom right.
  5. 5. Click on Edit code

    Click on Edit code

Copy the Cloudflare worker's source code from this link.

  1. 6. Replace the example code with the worker's source code

    Replace the example code with the worker's source code
  2. 7. Click on Save and deploy

    Click on Save and deploy
  3. 8. Click on Save and deploy again in the pop-up modal

    Click on Save and deploy again in the pop-up modal
  4. 9. Step back to the previous interface by clicking on the name of your worker on the top left.

    Step back to the previous interface by clicking on the name of your worker on the top left.
  5. 10. Click on Triggers

    Click on Triggers
  6. 11. Click on Add route

    Click on Add route
  7. 12. Type in your domain like this *example.com/*

    Type in your domain like this *example.com/*
  8. 13. Select the Zone where your site is.

    Select the Zone where your site is.
  9. 14. Click on Add route

    Click on Add route
  10. 15. Click on the Settings

    Click on the Settings
  11. 16. Select Variables on the left side.

    Select Variables on the left side.
  12. 17. Click on Add a Variable

    Click on Add a Variable
  13. 18. Copy your Prerender token from your dashboard

    You can find it at the top left on your Prerender dashboard.

    Copy your Prerender token from your dashboard
  14. 19. The name of the variable should be "PRERENDER_TOKEN" and the value should be the token you copied from your dashboard. Then click on Save and deploy

    The name of the variable should be "PRERENDER_TOKEN" and the value should be the token you copied from your dashboard. Then click on Save and deploy
  15. 20. Your Cloudflare worker should work.

    Your Prerender integration should be working now

    Your Cloudflare worker should work.