指定した期間に基づいて Cache-Control: s-maxage HTTP ヘッダーを設定します。
名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文
'宣言
Public Sub SetProxyMaxAge ( _
delta As TimeSpan _
)
'使用
Dim instance As HttpCachePolicy
Dim delta As TimeSpan
instance.SetProxyMaxAge(delta)
public void SetProxyMaxAge (
TimeSpan delta
)
public:
void SetProxyMaxAge (
TimeSpan delta
)
public void SetProxyMaxAge (
TimeSpan delta
)
public function SetProxyMaxAge (
delta : TimeSpan
)
適用できません。
パラメータ
- delta
Cache-Control: s-maxage ヘッダーを設定するために使用する期間。
例外
例外の種類 | 条件 |
---|---|
delta が 0 未満です。 |
解説
SetProxyMaxAge メソッドはスライド式有効期限は使用しません。また、有効期限が制限の原則に違反していると失敗します。
使用例
Cache-Control: s-maxage ヘッダーを 0 時間 30 分 0 秒に設定する方法を次のコード例に示します。
Dim ts As New TimeSpan(0,30,0)
Response.Cache.SetProxyMaxAge(ts)
TimeSpan ts = new TimeSpan(0,30,0);
Response.Cache.SetProxyMaxAge(ts);
TimeSpan ts = new TimeSpan(0, 30, 0);
get_Response().get_Cache().SetProxyMaxAge(ts);
var ts : TimeSpan = new TimeSpan(0,30,0)
Response.Cache.SetProxyMaxAge(ts)
プラットフォーム
Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition
Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。
バージョン情報
.NET Framework
サポート対象 : 3.0,2.0,1.1,1.0