asp.net.ph

HttpCachePolicy.SetProxyMaxAge Method

System.Web Namespace   HttpCachePolicy Class


Sets the Cache-Control: s-maxage HTTP header based on the specified time span.

[ VB ]
Public Sub SetProxyMaxAge ( _
   ByVal delta As TimeSpan _
)

[ C# ]
public void SetProxyMaxAge (
   TimeSpan delta
);

[ C++ ]
public: void SetProxyMaxAge (
   TimeSpan delta
);

[ JScript ]
public function SetProxyMaxAge (
   delta : TimeSpan
);

Parameters

delta
The time span used to set the Cache-Control: s-maxage header.

Exceptions


Exception Type Condition
ArgumentOutOfRangeException Occurs when delta is less than 0.

Remarks

SetProxyMaxAge does not use sliding expiration and will fail if the expiration date violates the principle of restrictiveness.

Example

[ VB, C#, JScript ] This example sets the Cache-Control: s-maxage header to 0 hours, 30 minutes, and 0 seconds.

[ VB ]
Dim ts As New TimeSpan ( 0,30,0 ) 
 Response.Cache.SetProxyMaxAge ( ts )

[ C# ]
TimeSpan ts = new TimeSpan ( 0,30,0 );
Response.Cache.SetProxyMaxAge ( ts );

[ JScript ] 
var ts : TimeSpan = new TimeSpan ( 0,30,0 ) 
Response.Cache.SetProxyMaxAge ( ts )
See Also

HttpCachePolicy Members   Caching ASP.NET Pages Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph