ASP 버퍼 속성


❮ 완전한 응답 객체 참조

Buffer 속성은 출력을 버퍼링할지 여부를 지정합니다. 출력이 버퍼링되면 서버는 모든 서버 스크립트가 처리되거나 스크립트가 Flush 또는 End 메서드를 호출할 때까지 브라우저에 대한 응답을 보류합니다.

참고: 이 속성이 설정된 경우 .asp 파일의 <html> 태그 앞에 있어야 합니다.

통사론

response.Buffer[=flag]

Parameter Description
flag A boolean value that specifies whether to buffer the page output or not.

False indicates no buffering. The server will send the output as it is processed. False is default for IIS version 4.0 (and earlier). Default for IIS version 5.0 (and later) is true.

True indicates buffering. The server will not send output until all of the scripts on the page have been processed, or until the Flush or End method has been called.

실시예 1

이 예에서는 루프가 완료되기 전에 브라우저에 출력이 전송되지 않습니다. 버퍼가 False로 설정된 경우 루프를 통과할 때마다 브라우저에 한 줄을 씁니다.

<%response.Buffer=true%>
<html>
<body>
<%
for i=1 to 100
  response.write(i & "<br>")
next
%>
</body>
</html>

실시예 2

<%response.Buffer=true%>
<html>
<body>
<p>I write some text, but I will control when
the text will be sent to the browser.</p>
<p>The text is not sent yet. I hold it back!</p>
<p>OK, let it go!</p>
<%response.Flush%>
</body>
</html>

실시예 3

<%response.Buffer=true%>
<html>
<body>
<p>This is some text I want to send to the user.</p>
<p>No, I changed my mind. I want to clear the text.</p>
<%response.Clear%>
</body>
</html>

❮ 완전한 응답 객체 참조