« Previous Next »

Thread: Can the maximum chunk size be configured?

Last post 11-18-2008 6:29 PM by anilr. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 11-18-2008, 10:44 AM

    • end.er
    • Not Ranked
    • Joined on 11-18-2008, 3:27 PM
    • Posts 5

    Can the maximum chunk size be configured?

     

    Hi all,

    I need to chunk responses to clients in a closed system. I know chunking can be done through c# in aspx pages. But what I would prefer is to tell IIS to send all responses as chunked with a maximum size of 16k bytes as the chunk size.

    Is this possible to do?

    What I need to do is send binary files to clients on request. The clients (custom apps, not web browsers) have limited ram available. A proposed solution is that the clients get the files (less than 10MB being about average size) in chunks. I would prefer  to not have to write code to read the file and send it in chunks, I would prefer that IIS handle it for me if possible.

    Thanks in advance

    Steve
  • 11-18-2008, 1:11 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: Can the maximum chunk size be configured?

    If you do a sequence of Response.Write(); followed by Response.Flush(); - the output of the Ewsponse.Write() will be chunked.  But, really, if you have the whole file, why do you want to use chunking - just use Response.TransmitFile() to send the file.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 11-18-2008, 1:41 PM In reply to

    • end.er
    • Not Ranked
    • Joined on 11-18-2008, 3:27 PM
    • Posts 5

    Re: Can the maximum chunk size be configured?

    As you can probably appreciate, in a corporate environment everything is not under my control. Although it is a closed system, the team doing the client has decided that they cannot accept more than about 8k worth of data at a time, so I need to chunk files that are larger. This is not something I can change. Other things, performance for example, are secondary.

     I would rather not have to do a sequence of writes and flushes. Since I know the maximum chunk size that is acceptable, I'm hoping that I could just configure IIS to use that as a default value. But I don't know how to tell IIS what the chunk size is that it should use. I deally it would be configurable on a per site basis. But that is not important at this time.

     

    I suppose an alternative is for the client to send partial GETs, specifying the byte range it wants.

  • 11-18-2008, 6:29 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: Can the maximum chunk size be configured?

    Sending the file in chunks (I assume you mean Transfer-Encoding:chunked) will not help with clients only being able to handle certain size at a time as the client side read can coalasce chunks - so, if the client really does not want more than certain amount of the file, Range request would be the way to go.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
Page 1 of 1 (4 items)
Microsoft Communities