Using Workers for Google Fonts

Hi

I am new to Cloudflare and was reading about Workers and optimizing Google fonts with workers. Was after a guide or a few tips on how i can get this up and running. I have 3 websites that i would be using it on and love to learn more about it all.

Many thanks

Danny

Patrick Meenan has an easy way to do this. He’s created a Worker that “localizes” Google Fonts so they can be cached at Cloudflare:

You’ll have to create that Worker Script, then configure a Route at your domain to run everything through the Worker.

1 Like

Hi I think I have done it correctly but not sure how to check. I add the code and called it google-fonts. Add the website. Is there a way i can check its worked?

Many thanks

Danny

Yes. If you open your browser’s Dev Tools panel (F12 in Chrome) and look at the Network Tab, you should see that the Google fonts are now loaded from your own domain.

Hi

Thanks for the response don’t think its working properly I have added a screenshot of the results.

Many thanks

Danny

Those images don’t list which domain the resources are loading from.

1 Like

Sorry about that school boy error. They are loading from the theme https://www.5starcruises.com.au/wp-content/plugins/js_composer/assets/lib/bower/font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0 or https://fonts.gstatic.com/s/poppins/v9/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2

Thanks

Danny