class ActiveStorage::Blobs::ProxyController

Authenticated Controllers.
require a higher level of protection consider implementing
generated URLs are hard to guess, but permanent by design. If your files
WARNING: All Active Storage controllers are publicly accessible by default. The
Proxy files through application. This avoids having a redirect and makes files easier to cache.

def show

def show
  if request.headers["Range"].present?
    send_blob_byte_range_data @blob, request.headers["Range"]
  else
    http_cache_forever public: true do
      response.headers["Accept-Ranges"] = "bytes"
      response.headers["Content-Length"] = @blob.byte_size.to_s
      send_blob_stream @blob, disposition: params[:disposition]
    end
  end
end