/workers-cdn

A small CDN built on top of Cloudflare Workers using the Cache API

Primary LanguageJavaScriptMIT LicenseMIT

workers-cdn

A small CDN built on top of Cloudflare Workers using the Cache API. All content is stored for up to 30 days and served directly from the Cloudflare Cache.

The file size is theoretically only limited by the Worker memory limit (128MB).

Deploy to Cloudflare Workers

Uploading

Cloudflare Workers do not support file uploads natively. The API therefore accepts the file as raw text encoded as a Data URL.

Request

curl - X POST -H "Content-Type: text/plain" --data 'data:image/jpeg;base64,/9j/2wBDAAUDBAQEAwUEBAQFBQUGBwwIB...' https://workers-cdn.x.workers.dev

Response

{
  "name": "qrpkheu97q",
  "url": "https://worker-cdn.x.workers.dev/qrpkheu97q"
}