ducktors / turborepo-remote-cache

Open source implementation of the Turborepo custom remote cache server.
https://ducktors.github.io/turborepo-remote-cache/
MIT License
996 stars 93 forks source link

Support Cloudflare Workers #155

Closed AdiRishi closed 1 year ago

AdiRishi commented 1 year ago

🚀 Feature Proposal - Add support for the Cloudflare Ecosystem

Make the necessary changes that will allow this server to be hosted on Cloudflare Workers and backed by Cloudflare R2 storage.

Motivation

Cloudflare workers are far more cost efficient and performant than the other serverless environments that currently exist. The option to deploy in the cloudflare ecosystem would also allow make it more performant to use Cloudflare R2 instead of Amazon S3. This is beneficial as R2 does not incur egress network costs.


I know that this may require a significant re-write, or switching to a server framework that runs on all environments, but it may be worth it to make this project the defacto option for anyone wanting to run a remote cache for Turborepo.

fox1t commented 1 year ago

Reference: https://blog.cloudflare.com/workers-node-js-asynclocalstorage/

We should add a CI step that tries to run turborepo-remote-cache on a Cloudflare worker to check the compatibility over time. @matteovivona

AdiRishi commented 1 year ago

I'm happy to withdraw this issue from my end. I've managed to setup my own custom remote cache for Cloudflare. Thanks for looking into potential support :)

warflash commented 8 months ago

@AdiRishi Did you open source the cloudflare implementation? I think a turborepo r2/workers cache would be really interesting but couldn't find much on that matter yet

AdiRishi commented 8 months ago

@AdiRishi Did you open source the cloudflare implementation? I think a turborepo r2/workers cache would be really interesting but couldn't find much on that matter yet

@warflash yes I did 😄 - https://github.com/AdiRishi/turborepo-remote-cache-cloudflare

warflash commented 8 months ago

Damn that was one hell of a quick response, appreciate that. Will look into that 👀

fox1t commented 8 months ago

@AdiRishi, this is amazing! Would you like to have a quick chat about scripts remote-caching? We want to evolve our implementation, and we might join forces :)

AdiRishi commented 8 months ago

@fox1t for sure, I'd love to chat. I'll reach out to you on Twitter/X.