Cloudflare Workers make it possible to write Javascript which runs on Cloudflare’s network around the world. Using Workers you can build services which run exceptionally close to your users. You can also intercept any request which would ordinarily travel through Cloudflare to your origin, and modify it in any way you need. Workers can make requests to arbitrary resources on the Internet, can perform cryptography using the WebCrypto API, and can do almost anything you might be used to configuring your CDN to accomplish.
This repository is intended to contain examples of how Workers can be used to accomplish common tasks. You are welcome to use, modify, and extend this code! If you have an additional example you think would be valuable, please submit a pull request.
Questions about Workers can be addressed on our community site or by reaching out to the Worker Support team, we’re here to help!