Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response.Buffer

Status
Not open for further replies.

daShader

Programmer
Jul 12, 2000
9
US
guys any way to READ the buffer?<br><br>Response.Clear to clear it<br>Response.Flush to send it to client..<br><br>but how in the world to read it?<br><br>maybe 3rd party ASP component?<br><br>
 
The buffer isnt intended to be read, its more or less at the top of your page you say<br><br>Response.Buffer = True, one of the main reasons for doing this is, that if something happens during the processing of the page, and you need to redirect to an error page, or perhaps you dont want to show the processing ASP at all.<br><br>if you were to try Response.redirect and you've already sent data back to the client, the page would generate a runtime error. you need to buffer for some reasons, such as being able to redirect without a problem, waiting on large quanities of data to load, but not show it spitting back in peices. etc. The buffer <b>is the page</b>. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Yes, I have Response.Buffer = true at top of them page, so the date is not sent to client. <br><br>And the thing I am trying to do is page caching, for example I have table in page that takes 6 sec to render. So I was thinking of reading that rendered table from buffer and store it somewhere. THen I won't have to render it again.<br><br>One of the ways to do is just to store HTML in a str variable.. like insted of <br><br>&lt;%<br>Put mark in buffer<br>%&gt;<br>&lt;table name=tobecached&gt;<br>&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;<br>&lt;/table&gt;<br>&lt;%<br>Cach the buffer<br>%&gt;<br><br>I will need to do<br><br>&lt;%<br>strCache =&quot;&lt;table name=tobecached&gt;&quot; _<br>& &quot;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&quot;<br>& &quot;&lt;/table&gt;&quot;<br>cache the strCache<br>%&gt;<br><br>it's ok for small chunks of code.. but there is no need to cache sall chunks :)<br><br>so I sould prefer to read the rendered code from buffer..<br><br><br>
 
um, if it hasnt occured to you, if the webbrowser has cache enabled anyways, it's going to use it's already rendered HTML thats in it's cache folder. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
I can't rely on browsers cache. Only part of the page I am creating neeeds to be cached, the rest is dynamic.<br><br>For example, I have a page with date on it.. I need all but date to be cached.<br><br>
 
well save that portion as a string <br><br>HtmlStr = &quot;&lt;BR....&quot; & somevar & &quot;...&gt;&quot;<br><br>and use response.write to spit it back in the section you want. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
what about that porion is like 100 lines a mix of ASP and HTML in it, lie looping through recordsets<br><br>for example<br>&lt;table&gt;<br>&lt;%<br>while not ors.eof<br>&nbsp;&nbsp;%&gt;<br>&nbsp;&nbsp;&lt;tr&gt;<br>&nbsp;&nbsp;&lt;td&gt;<br>&nbsp;&nbsp;&lt;font color=&quot;&lt;%=ors(&quot;color&quot;)%&gt;&quot;&gt;<br>&nbsp;&nbsp;ors(&quot;name&quot;)<br>&nbsp;&nbsp;&lt;/font&gt;<br>&nbsp;&nbsp;&lt;/td&gt;<br>&nbsp;&nbsp;&lt;td&gt;<br>&nbsp;&nbsp;&lt;font color=&quot;&lt;%=ors(&quot;color&quot;)%&gt;&quot;&gt;<br>&nbsp;&nbsp;ors(&quot;make&quot;)<br>&nbsp;&nbsp;&lt;/font&gt;<br>&nbsp;&nbsp;&lt;/td&gt;<br>&nbsp;&nbsp;&lt;/tr&gt;<br>&nbsp;&nbsp;&lt;%<br>&nbsp;&nbsp;ors.movenext<br>wend<br>%&gt;<br>&lt;/table&gt;<br><br>and so on, imagine a code 10x bigger and mroe complicated than this... it will be a pain to stick it in variable.. possible but painful... but I might need to do it.. 'cause I can't read the rendered text... I wish I can do something like<br><br>&lt;%strTemp = &quot;%&gt;fhdkjhkjfhk, &lt;%=intVar%&gt; html code &lt;%&quot;%&gt;<br>&nbsp;&nbsp;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top