When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles [1.x] [2.0]
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips
Search

Sections:
Book Reviews
Sample Chapters
Commonly Asked Message Board Questions
Headlines from ASPWire.com
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
Web Hosts
XML Info
Information:
Advertise
Feedback
Author an Article
Technology Jobs

















internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers
ASP ASP.NET ASP FAQs Message Board Feedback ASP Jobs
Print this page.

Windows Systems Administrator
Jupitermedia
US-CT-Darien

Justtechjobs.com Post A Job | Post A Resume

Published: Saturday, October 24, 1998

WebDaily: Your daily source for Web Technology Tips and Tricks!


*****************************************************************
The Response Object
*****************************************************************

* This article deals with the Active Server Pages Response object

If you're an ASP developer, you've no doubt used the Response object several times. If we had a nickel for each time we've used:

Response.Write "blah"

we'd all be as rich as Bill Gates! Anyway, there are many more useful properties and methods for the Response object that don't get discussed as often on listservs or on ASP web sites. This email will detail some of these properties and methods.

- continued -


Response.Buffer = TRUE | FALSE
Response.Buffer is a value to set whether or not ASP buffers the code before sending it to the client. For example, if you start your ASP page with Response.Buffer = True, the entire ASP script will be processed before it is sent to the client. If it is set to false (which is the default in ASP 2.0 / ASP 1.0), the client will get the code as it's parsed by the server. (ASP 3.0, by default, has buffer set to True.)

There are certain times when you want to set Response.Buffer = True. If you do a redirect from your ASP page (using JavaScript's or VBScript's document.location property) after HTML content has been sent to the client, Netscape will present an ugly screen stating to the user that he or she is being redirected. If you have Buffering set to true, they won't see this alarming message.

Another use for Buffering is if you do not want to let your user leave the current page until you've finished processing all of the ASP scripts associated with that page. (You may want to do some database calls that you don't want to have interrupted by the user clicking the back button, or click a hyperlink. This is a good time to use the Buffer property.)

Buffering is also a performance enhancer. For more information on how setting Response.Buffer to True will enhance the performance of your ASP pages, be sure to read: Buffer that Output, by Charles Carroll.

Response.Expires = number
Response.Expires sets the time in minutes before a page expires. This determines how long a user's browser will cache the page. There are times when you do not want the page cached. Say that you have an ASP page that the user enters information into a database. Once they type in the information, they are sent to a page which submits the information to the database, then returns them to the same page, showing the updated database data. You want the user to see the data they just entered; however, if the page is cached, they won't see their entry, and will think that their information didn't get entered into the system. To remedy this problem, simply add the following line of code at the top of your ASP file:
Response.Expires = 0

You can also set it to other values. If you have a page that is dynamically updated every 15 minutes, you may wish to set Response.Expires to 15, so the page is only cached for a short 15 minutes.

Learn More About Caching!
To learn more about caching be sure to check out the Caching Article Index. This index contains numerous links to various articles on caching smattered across the Web.

Response.ExpiresAbsolute = [date] [time]
This property is very similar to the Response.Expires property, but rather than setting an elapsed time before the page is no longer cached by a browser, ExpiresAbsolute allows you to set a specific date and/or time when your page will need to be removed from cache.
Here is an example:

'This page will expire on 12/3/98
Response.ExpiresAbsolute = #December 3,1998#

'This page will expire at 1:30 pm on Christmas day, 1998
Response.ExpiresAbsolute = #December 25,1998 13:30#

*****************************************************************
*****************************************************************
To subscribe to WebDaily, point your browser to:
http://www.4GuysFromRolla.com/WebWeekly/
*****************************************************************
*****************************************************************


Windows Internet Technology | ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Microsoft Article: 7.0, Microsoft's Lucky Version?
Microsoft Article: Hyper-V--The Killer Feature in Windows Server 2008
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Windows Server 2008
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES