Configure caching and rewinding in Down::ChunkedIO
masterBy default, Down::ChunkedIO caches downloaded content into a Tempfile so that you can #rewind the stream and re-read data.
If you want to reduce disk usage and IO calls and do not need to rewind, you can disable caching by passing rewindable: false to Down.open.
# Default behavior (rewindable)
remote_file = Down.open("http://example.com/image.jpg")
remote_file.read(1*1024*1024)
remote_file.rewind
remote_file.read(1*1024*1024) # reads from cache
# Disable caching
Down.open("http://example.com/image.jpg", rewindable: false)