Cloudflare WorkersとRustを使って画像をリサイズするサンプルです。
- バグがあるのでworkerをこのPRをマージして独自ビルドする必要があります。(2021/12/4現在)
- Cache APIは未実装。PRが出てるのでマージして独自ビルドすれば使えます。サンプル内では未使用です。
- JPEGは jpeg_rayon という並列処理の機能を外さないと動かないことに注意が必要です。関連Issue
# compiles your project to WebAssembly and will warn of any issues
wrangler build
# run your Worker in an ideal development workflow (with a local server, file watcher & more)
wrangler dev
# deploy your Worker globally to the Cloudflare network (update your wrangler.toml file for configuration)
wrangler publish