Closed mrkurt closed 5 years ago
The in memory cache is great, but lots of apps need to cache much larger amounts of data.
I think the best way to do this is to expose another fetch URL protocol within isolates with an S3 like adapter for persisting files.
It needs to:
Stream handling is important. This should be fast:
fly.http.respondWith(async (req) => { let resp = await fetch("storage://big-file.mkv") return resp });
Likewise, so should this:
fly.http.respondWith(async (req) => { let resp = await fetch("https://origin.example.com/big-file.mkv"); await fetch("storage://big-file.mkv", { method: "PUT" }); return new Response('file saved!'); });
Fetching an external URL only sends header data into the isolate, unless you read the body within app code. This should work the same.
The in memory cache is great, but lots of apps need to cache much larger amounts of data.
I think the best way to do this is to expose another fetch URL protocol within isolates with an S3 like adapter for persisting files.
It needs to:
Stream handling is important. This should be fast:
Likewise, so should this:
Fetching an external URL only sends header data into the isolate, unless you read the body within app code. This should work the same.