Name

CacheControl

Synopsis

Response.CacheControl = String

Sets the cacheability of the current page.

Parameters

String

A string variable containing the value to set for the CacheControl property. Valid values include “Public” and “Private”.

Example

Sub Page_Load(  )
   Response.CacheControl = "Public"
   Response.Expires = 2
   Message.Text = Now.ToString(  ) 
End Sub

The output of the code above should be identical to the previous example.

Notes

This property has been deprecated in favor of the HttpCacheability class methods.

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.