Ability to terminate range requests

Today I learned about Range requests. A library, that I am using in my client-side code, issues such against my web back-end, which doesn’t support them, though. However, the back-end is reverse-proxied by Caddy, so I thought Caddy’s reverse_proxy directive might actually be able to resolve these range requests.

Caddy could act as kind of a “facade”, that accepts range requests even for upstreams, that don’t support such. In that case, Caddy would slice off certain parts of the response body, according to the requested byte range in case the upstream returns more bytes than requested by Range header. Of course, between upstream and Caddy, the entire response would be transferred, but the outside client would only receive their requested byte range.

Is that something to be considered? Or do you see any issues here? I also might well have misunderstood the concept of range requests.

Sure, that’d make a good HTTP handler module. It wouldn’t be as efficient as the origin honoring Range from the start, but it could still be helpful in cases where they don’t.

(This can easily be a plugin, doesn’t have to be part of the standard distribution.)

1 Like

This topic was automatically closed after 60 days. New replies are no longer allowed.