ruby on rails 3 - Does Amazon S3 help anything in this case? -
i'm thinking whether host uploaded media files (video , audio) on s3 instead of locally. need check user's permissions on each download.
so there action get_file
, first checks user's permissions , gets file s3 , sends using send_file user.
def get_file if @user.can_download(params[:file_id]) # first, download file s3 , send user using send_file end end
but in case, server (unnecessarily) downloads file first s3 , sends user. thought use case s3 bypass rails/http server stack reduced load.
am thinking wrong?
ps. i'm using carrierwave file uploads. not sure if that's relevant.
amazon s3 provides called restful authenticated reads, timeoutable urls otherwise protected content.
carrierwave provides support this. declare s3 access policy authenticated read:
config.s3_access_policy = :authenticated_read
and model.file.url
automatically generate restful url.
Comments
Post a Comment