Feature request: Add http caching to fly-proxy

Hi. In Static cache not caching - #2 by kurt, kurt answered that “We’ll probably need to have HTTP caching-like-a-CDN someday.” That post was from before Fly machines were released. Now that they were, I think http caching in fly-proxy would be even more valuable, because an app that isn’t doing anything shouldn’t be running. Sure, I can deploy my own nginx or Varnish cluster onto 24 instances to cover each fly.io region, but if I scale them to 0 when idle, then the occasional request that comes in will have a 300ms latency, and if I let them always run in order to serve the occasional request fast, then that just feels wasteful. For me, the ideal architecture would be for fly.io to serve cache hits, and only cold start my scale-to-0 machines for cache misses. And while I can use an external CDN in the meantime, it would be great to not have to.

If you’re interested in creating this, https://crates.io/crates/http-cache-semantics seems like it could give you a good start. The one feature not covered by RFC 7234 / 9111 that would be super valuable to add would be Varnish’s ykey, aka Fastly’s Surrogate-Key.

I’m sure all of you at fly.io are super busy with way more things on your roadmap than you have time to implement, so no worries if it takes a while for this to bubble up in priority; just wanted to write this request up. :slight_smile:

1 Like