Professional Web Applications Themes

Pluses and Minuses of using Response.Buffer = True - ASP Database

Hi All Could somebody outline what are the pluses and minuses of using Response.Buffer = True at the top of my ASP pages. I was told by a poster a long time ago that using this command if you can get away with it gives a better output (?!?!?), but I never found out what he meant by getting away with it or what he meant by a better output. Thanks Laphan...

  1. #1

    Default Pluses and Minuses of using Response.Buffer = True

    Hi All

    Could somebody outline what are the pluses and minuses of using
    Response.Buffer = True at the top of my ASP pages.

    I was told by a poster a long time ago that using this command if you can
    get away with it gives a better output (?!?!?), but I never found out what
    he meant by getting away with it or what he meant by a better output.

    Thanks

    Laphan


    Laphan Guest

  2. #2

    Default Re: Pluses and Minuses of using Response.Buffer = True

    Generally, you will get better performance.

    IIS will hang onto the entire response before placing it onto the network.
    This leads to nice, full, packets leaving the server, and a minimum of
    switches between ASP processing something, and Windows placing packets onto
    the wire.

    If you have buffering *off*, then IIS will continually be placing dribs and
    drabs of output onto the wire. If you want to test it, try doing this:

    <%
    For i = 1 to 100000
    Response.Write("Hello" & "<br>")
    Next
    %>

    Do the above with buffering on, and with buffering off. One should take a
    significantly shorter time than the other (obviously you should do this
    across the network)

    Cheers
    Ken


    "Laphan" <co.uk> wrote in message
    news:eyVrFQ%phx.gbl... 


    Ken Guest

  3. #3

    Default Re: Pluses and Minuses of using Response.Buffer = True

    Laphan wrote: 

    Ken Schaefer's ysis is spot on.

    A little IIS history:
    IIRC IIS4 and IIS3 had buffering *disabled* (FALSE) by default. But
    buffering is enabled (TRUE) by default for IIS5 and later versions.
    That may explain why the poster you referenced suggesting setting
    Response.Buffer = TRUE.

    So while it is no longer _usually_ necessary, if there is a need to
    enable buffering (e.g., the code includes calls to Response.Clear), then
    you should keep the statement in your code.

    Good Luck,
    Michael D. Kersey
    Michael Guest

  4. #4

    Default Re: Pluses and Minuses of using Response.Buffer = True

    Hi Guys

    Thanks for the replies.

    The reason I wanted to know any negative sides to this is that the site that
    I have currently done is experiencing a lot of server timeouts even though
    the script execution should be an enormous burden.

    I used .GetRows on all of the DB retrieval work thinking that this would
    give better speed (I use about 3 or 4 DB query calls per page whilst still
    using the same 1 connection), but I have a feeling that because I am using
    Response.Buffer = True My ISP's IIS is classing all of the calls as one and
    generating a timeout because of the time it is taking to do everything
    before it returns it all. Could this be the case?

    I don't want to do the classic answer of increasing the timeout delay, as I
    think I would be disguising a problem.

    Rgds

    Robbie


    "Michael D. Kersey" <org> wrote in message
    news:phx.gbl...
    Laphan wrote: 

    Ken Schaefer's ysis is spot on.

    A little IIS history:
    IIRC IIS4 and IIS3 had buffering *disabled* (FALSE) by default. But
    buffering is enabled (TRUE) by default for IIS5 and later versions.
    That may explain why the poster you referenced suggesting setting
    Response.Buffer = TRUE.

    So while it is no longer _usually_ necessary, if there is a need to
    enable buffering (e.g., the code includes calls to Response.Clear), then
    you should keep the statement in your code.

    Good Luck,
    Michael D. Kersey





    Astra Guest

  5. #5

    Default Re: Pluses and Minuses of using Response.Buffer = True

    We would need to see the script - it would probably have more impact on the
    speed / timeout issue than setting the buffer


    "Astra" <com> wrote in message
    news:phx.gbl... 
    that 
    and 
    I [/ref]
    can [/ref]
    what 
    >
    > Ken Schaefer's ysis is spot on.
    >
    > A little IIS history:
    > IIRC IIS4 and IIS3 had buffering *disabled* (FALSE) by default. But
    > buffering is enabled (TRUE) by default for IIS5 and later versions.
    > That may explain why the poster you referenced suggesting setting
    > Response.Buffer = TRUE.
    >
    > So while it is no longer _usually_ necessary, if there is a need to
    > enable buffering (e.g., the code includes calls to Response.Clear), then
    > you should keep the statement in your code.
    >
    > Good Luck,
    > Michael D. Kersey
    >
    >
    >
    >
    >[/ref]


    dave Guest

  6. #6

    Default Re: Pluses and Minuses of using Response.Buffer = True

    Buffering should have no effect on a server-side script timeout...

    Cheers
    Ken

    "Astra" <com> wrote in message
    news:phx.gbl... 
    >
    > Ken Schaefer's ysis is spot on.
    >
    > A little IIS history:
    > IIRC IIS4 and IIS3 had buffering *disabled* (FALSE) by default. But
    > buffering is enabled (TRUE) by default for IIS5 and later versions.
    > That may explain why the poster you referenced suggesting setting
    > Response.Buffer = TRUE.
    >
    > So while it is no longer _usually_ necessary, if there is a need to
    > enable buffering (e.g., the code includes calls to Response.Clear), then
    > you should keep the statement in your code.
    >
    > Good Luck,
    > Michael D. Kersey
    >
    >
    >
    >
    >[/ref]


    Ken Guest

  7. #7

    Default Re: Pluses and Minuses of using Response.Buffer = True

    Hi Guys

    I will put together a script sample so you can see it, but it seems really
    weird that the exact same page scripts run fine one minute and are then
    timing out the next.

    I know the first thing you are going to say is that I should be using PHP
    rather than my chosen combo of ASP (on a W2003 Server) > MyODBC (on the same
    W2003 Server) > MySQL 4 db (on a Linux server - I think), but this seems to
    work really well when it does.

    Do you know of any issues with the above combo?

    Rgds

    Robbie


    "Ken Schaefer" <com> wrote in message
    news:phx.gbl...
    Buffering should have no effect on a server-side script timeout...

    Cheers
    Ken

    "Astra" <com> wrote in message
    news:phx.gbl... 
    >
    > Ken Schaefer's ysis is spot on.
    >
    > A little IIS history:
    > IIRC IIS4 and IIS3 had buffering *disabled* (FALSE) by default. But
    > buffering is enabled (TRUE) by default for IIS5 and later versions.
    > That may explain why the poster you referenced suggesting setting
    > Response.Buffer = TRUE.
    >
    > So while it is no longer _usually_ necessary, if there is a need to
    > enable buffering (e.g., the code includes calls to Response.Clear), then
    > you should keep the statement in your code.
    >
    > Good Luck,
    > Michael D. Kersey
    >
    >
    >
    >
    >[/ref]



    Astra Guest

  8. #8

    Default Re: Pluses and Minuses of using Response.Buffer = True

    Interesting.

    Agree with all that has been written.

    Just adding my two cents here... with buffering on, my server often fails to
    deliver the whole output from an ASP page to the client. This may well be a
    network problem somewhere along the line, but with buffering off the problem
    occurs a lot less often.

    I have been through this all with MS Support who drew a blank and blamed it
    on the network. I was curious how the buffering state affected the problem
    and also why the problem occurred less often when I put SQL server on to the
    same machine rather than connecting to it on a different machine.

    Hmm....


    "Astra" <com> wrote in message
    news:phx.gbl... 
    that 
    and 
    I [/ref]
    can [/ref]
    what 
    >
    > Ken Schaefer's ysis is spot on.
    >
    > A little IIS history:
    > IIRC IIS4 and IIS3 had buffering *disabled* (FALSE) by default. But
    > buffering is enabled (TRUE) by default for IIS5 and later versions.
    > That may explain why the poster you referenced suggesting setting
    > Response.Buffer = TRUE.
    >
    > So while it is no longer _usually_ necessary, if there is a need to
    > enable buffering (e.g., the code includes calls to Response.Clear), then
    > you should keep the statement in your code.
    >
    > Good Luck,
    > Michael D. Kersey
    >
    >
    >
    >
    >[/ref]


    David Guest

Similar Threads

  1. Response Buffer Limit Exceeded - Ideas Please!
    By Brian in forum ASP Database
    Replies: 2
    Last Post: September 8th, 12:15 PM
  2. Replies: 5
    Last Post: April 12th, 02:24 AM
  3. Response.buffer doesnt work
    By Copa in forum ASP
    Replies: 0
    Last Post: August 21st, 05:13 PM
  4. Response.Buffer
    By PJ in forum ASP.NET General
    Replies: 5
    Last Post: July 23rd, 01:22 AM
  5. Replies: 0
    Last Post: July 5th, 04:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139