Skip to content

Latest commit

 

History

History
27 lines (25 loc) · 1.85 KB

cloudflare-worker.md

File metadata and controls

27 lines (25 loc) · 1.85 KB

CloudFlare Worker Integration

Step-by-step integration instructions for ostr.io pre-rendering via CloudFlare Workers

  1. Sign up for ostr.io
  2. Add server/domain following on-boarding guidance
  3. Verify domain ownership using DNS TXT record adding via CloudFlare interface
  4. Inside server's panel click on add next to "Pre-rendering & SSR for SEO"
  5. Inside server's pre-rendering panel scroll down to integration guide
  6. In the first CURL tab grab "Authorization Header" starting from Basic... and ending with closing double-quotes
  7. Create CF Worker:
    • Workers > Create: Create Worker via CloudFlare Dashboard
    • Workers > Settings > Variables: Place copied header as OSTR_AUTH to WebWorker's environment variables OR replace env.OSTR_AUTH with Authentication Header value from step 6
    • Workers > Settings > Edit Code: Paste CF Worker Code
  8. Connect Worker to a website
    • Websites > example.com > Workers Routes > [Add Route]
    • Route: *.example.com/*
    • Worker: Select newly created worker
    • Click on save
  9. Purge cache: Websites > example.com > Caching > Configuration > Purge Everything
  10. Check X-Prerender-Id header to confirm that pre-rendering works
    • Request using cURL: curl -v -A GoogleBot https://example.com/
    • Ensure X-Prerender-Id header returned with response
    • Check ostr.io: Rendering statistics will appear in real-time
  11. Further reading: