3

Does Nginx or HTTP 1/2 offer ways serve a file in reverse byte order? I'm interested in reading a binary HTTP Response stream in reverse byte order to seek a byte sequence from the end of files (which range from 5-500 MB). My current solution uses iterative Range requests and byte scanning with the Streams API. That suffices but is not optimal.

The implementation goal is to calculate durations of Opus audio files as explained by "How do I get the duration of a .opus file?". A server-side script (Python, Go, PHP) could always work as a fallback, but I'm curious if Nginx or another HTTP server can already do it out-of-the-box. Preserving Opus' low-latency is important. If an existing option does not, a custom Nginx module would be written that responds with HTTP headers containing the duration (and other Opus meta info).

anthumchris
  • 8,245
  • 2
  • 28
  • 53

0 Answers0