xFelix
xFelix
Speed up WordPress site by using Cloudflare Workers Edge Cache

I am exploring use case of Cloudflare Workers these days. One of useful function is to leverage Cloudflare workers to serve as edge cache to speed up website load time and user experience.

Here are some simple steps to get it setup fast

  1. Install Cloudflare Page Cache WordPress Plugin
  2. Go to Cloudflare > Workers
  3. Click ‘Add Script’
  4. Give a name

    (any name)

  5. Click ‘Edit’
  6. Delete all existing code
  7. Add ‘Route’

    Copy codes from https://raw.githubusercontent.com/cloudflare/worker-examples/master/examples/edge-cache-html/edge-cache-html.js

    Paste Workers codes

    Edit codes with your Cloudflare credentials

    email: “”, // From https://dash.cloudflare.com/profile
    key: “”,   // Global API Key from https://dash.cloudflare.com/profile
    zone: “”   // “Zone ID” from the API section of the dashboard overview page https://dash.cloudflare.com/

  8. Add ‘Route’
  9. Create Route

    Refer https://developers.cloudflare.com/workers/about/routes/#matching-behavior for how to write a route.

    Click on dropdown and select your script

    Click ‘Save’

All Done!

Written by Felix. Licensed under CC BY-NC-SA 3.0 Unported.

Leave a Reply

textsms
account_circle
email

  • Wow just noticed one thing, the long blog title in MDx theme will be broke apart in the middle of a latin word (which is kind of annoying)

    6 monthsago replied

xFelix

Speed up WordPress site by using Cloudflare Workers Edge Cache
I am exploring use case of Cloudflare Workers these days. One of useful function is to leverage Cloudflare workers to serve as edge cache to speed up website load time and us…
Scan QR code to continue reading
2020-01-17