Hi there! I'm trying to build a worker that does realtime audio "splicing" from component mp3s. Esse
Hi there! I'm trying to build a worker that does realtime audio "splicing" from component mp3s. Essentially based on an audio file layout, grab the files from r2, remove header info and splice the mp3 audio data together and stream.
I've succeeded in building this. But now I'm running into a problem that seems maybe unsolvable: clients expect to be able to issue range requests in a header asking for specific bytes in the audio (I'd like to listen starting at 10:00 in...).
What I'd ideally like is that an initial request will be cached entirely, and then the cdn would take over to respond to the range request with a proper 206 response and the bits. There doesn't seem to be a way to do this.
I've succeeded in building this. But now I'm running into a problem that seems maybe unsolvable: clients expect to be able to issue range requests in a header asking for specific bytes in the audio (I'd like to listen starting at 10:00 in...).
What I'd ideally like is that an initial request will be cached entirely, and then the cdn would take over to respond to the range request with a proper 206 response and the bits. There doesn't seem to be a way to do this.
- If I respond with a 206 from the worker, it can't be cached
- If I respond with a 200 with the whole file, the client doesn't get what it asked for