Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7055455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:45:04+00:00 2026-05-28T03:45:04+00:00

If the file sent with send_file is similar in size to the default buffer

  • 0

If the file sent with send_file is similar in size to the default buffer size (4096 bytes), does it always make sense to use stream: false? For example, are there proxies or browsers that break badly if the buffer size is non-standard?

Related:

  1. Does the buffer size refer to the file or the HTTP packet?
  2. Can you recommend a Firefox extension to inspect HTTP packets at this level?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:45:04+00:00Added an answer on May 28, 2026 at 3:45 am

    If you look at the source, rails basically does

    File.open(path, 'rb') do |file|
      while buf = file.read(len)
        output.write(buf)
      end
    end
    

    And the buffer_size option controls the value of len. Very small values of len are inefficient in terms of IO activity, very large values are wasteful of memory. How this then gets broken up into tcp packets is not under your control. If you were to change the value, increasing it to the size of the file would just be wasteful – I don’t think you’d need anything more than a few hundred k – 128k or 256k would be ample. Optimal buffer sizes will be operating system / hardware dependant.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can i receive a file sent by an applet to the server by
File is sent to the client using Response.writefile and content diposition as inline. When
A buddy sent me a later version of an .apk file. I already had
I use dephi7's client/server socket components to send a file with tfilestream from client
I am trying to stream/pipe a file to the user's browser through HTTP from
I have the following code to send a (file) stream to a wcf client:
My question is similar to Download and open pdf file using Ajax But not
I am in a strange situation where send_file is unable to send file correctly.
I am trying to send a file via send_file, in rails 3... The file
File formats I would like to play include .wav, .mp3, .midi. I have tried

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.