please dont rip this site
Platform SDK: IIS SDK
      [IIS 5.0] [IIS 5.1] [IIS 6.0]

Response.CacheControl

The CacheControl property enables you to set the HTTP/1.1 Cache Control header in Response.Syntax

The values for CacheControl are strings, and must be enclosed in quotation marks (" "). You must set CacheControl before any response is sent to the client, unless response buffering is enabled.

Syntax

Response.CacheControl [= Cache Control Header ]

Parameters

Cache Control Header
The following is a partial list of values supported by the HTTP/1.1 Protocol. For more complete descriptions, see the Hypertext Transfer Protocol, HTTP/1.1 specification of section 14.9 on the World Wide Web Consortium Web site.
Value Description
Private
A cache mechanism may cache this page in a private cache and resend it only to a single client. This is the default value. Most proxy servers will not cache pages with this setting.
Public
Shared caches, such as proxy servers, will cache pages with this setting. The cached page can be sent to any user.
No-cache
Do not cache this page, even if for use by the same client.
No-store
The response and the request that created it must not be stored on any cache, whether shared or private. The storage inferred here is nonvolatile storage, such as tape backups. This is not an infallible security measure.

Note

Between your Web server and a user requesting your page, there may be proxy servers configured to cache Web pages for faster response times. Usually ASP pages are developed to be unique for each user or may contain secure information. For this reason, IIS sets this property to "Private" so that proxy servers or other cache mechanisms will not cache pages. You can override this default value, setting it to any value supported by the HTTP/1.1 protocol. For more information, see the Hypertext Transfer Protocol, HTTP/1.1 specification of section 14.9 on the World Wide Web Consortium Web site.

If there is no cache mechanism between your Web server and a client computer, or if a proxy server is running HTTP/1.0, CacheControl will be ignored.

Setting CacheControl to "Public" may seem to improve the performance of your .asp files, but it is discouraged if you generate custom HTML for every request, and a proxy server might interfere with the response.

Example

CacheControl comes before the <HTML> tag to ensure that it is set before content is sent to the client.

--- CacheControl_NoBuffer.asp ---

<%

  Response.Buffer =index.html False

  Response.CacheControl = "private"

%>

<HTML><HEAD><TITLE>Response.CacheControl Example</TITLE></HEAD>

<BODY>

Output from this page is sent to the client as it is being processed.<BR>

It will not be cached.<BR>

Today is <%= Date %>, <%= Time %><BR>

<H3>Please enter your credit card number:</H3>

<FORM NAME="Order" METHOD="POST" ACTION="order.asp ">

<INPUT TYPE="TEXT" NAME="CreditCard">

<INPUT TYPE="SUBMIT" VALUE="Submit" NAME="Submit">

</FORM>

</BODY>

</HTML>

--- CacheControl_Buffer.asp ---

<% Response.Buffer =index.html True %>

<HTML><HEAD><TITLE>Response.CacheControl Example</TITLE></HEAD>

<BODY>

Output from this page is sent to the client once it is completely processed by the server, so we can set CacheControl anytime.<BR>

<% Response.CacheControl = "private" %>

It will not be cached.<BR>

Today is <%= Date %>, <%= Time %><BR>

<H3>Please enter your credit card number:</H3>

<FORM NAME="Order" METHOD="POST" ACTION="order.asp ">

<INPUT TYPE="TEXT" NAME="CreditCard">

<INPUT TYPE="SUBMIT" VALUE="Submit" NAME="Submit">

</FORM>

</BODY>

</HTML>

Applies To

Response Object

Requirements

Platforms: Windows 2000 with IIS 5.0 installed, Windows XP with IIS 5.1 installed, Windows Server 2003 family with IIS 6.0 installed

Platform SDK Release: February 2003
What did you think of this topic?
Order a Platform SDK CD


file: /Techref/language/asp/OBJ/ref_vbom_resopcc.htm, 6KB, , updated: 2003/5/15 14:13, local time: 2024/3/29 05:12,
TOP NEW HELP FIND: 
3.238.6.55:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://www.sxlist.com/techref/language/asp/OBJ/ref_vbom_resopcc.htm"> Response.CacheControl</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 

Welcome to www.sxlist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .