
360
|
Chapter 17: The HttpResponse Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
You can see similar behavior by commenting out the Response.BufferOutput lines
in the example (by prepending a single-quote (
') character to the line), and
uncommenting the Response.Flush line. This commenting and uncommenting
will eliminate the pause in the output described previously.
The call to the Shared (static) Thread.Sleep method allows us to pause processing
of an ASP.NET request for a given number of milliseconds. This can be useful
when you need to wait during processing for whatever reason. However, using
this method can impact the total time each request takes to process. In applica-
tions requiring high scalability, this may result in an unacceptable impact on the
overall throughput of the application, since only a limited number of threads are
available to process requests.
To avoid explicitly providing the namespace name when calling Thread.Sleep,
add the following line to the page, immediately following the
@ Page declaration:
<%@ Import Namespace="System.Threading" %>
Notes
This property is the ASP.NET equivalent of classic ASP’s Buffer property and is
preferred over Buffer for new development.
Cache
HttpCachePolicy = Response.Cache
Returns an instance of the HttpCachePolicy class that contains the cache policy of
the page. You can use ...