Rails 7: ActiveStorage::Streaming improves streaming from the controller

In the era of content consumption where streaming platforms like YouTube and Netflix have millions of concurrent users, no one wants to wait more than a minute to consume anything, it must be available instantly! Streaming becomes a need in this situation. While downloading requires waiting until the entire file has been downloaded on your computer, streaming allows you to view downloaded portions of the material on the fly. This significantly reduces the waiting time. Let's see with the help of a small example how streaming was handled before Rails 7 and what changed after Rails 7. With Rails <