HttpResponse.AddCacheDependency メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HttpResponse.AddCacheDependency メソッドの意味・解説 

HttpResponse.AddCacheDependency メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

応答出力キャッシュ格納されていて、指定した依存関係変化した場合キャッシュ依存関係セット応答関連付け応答効率的に無効化ます。

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub AddCacheDependency ( _
    ParamArray dependencies As CacheDependency()
 _
)
Dim instance As HttpResponse
Dim dependencies As CacheDependency()

instance.AddCacheDependency(dependencies)
public void AddCacheDependency (
    params CacheDependency[] dependencies
)
public:
void AddCacheDependency (
    ... array<CacheDependency^>^ dependencies
)
public void AddCacheDependency (
    CacheDependency[] dependencies
)
public function AddCacheDependency (
    ... dependencies : CacheDependency[]
)

パラメータ

dependencies

アプリケーション依存関係リスト追加するファイルキャッシュ キー、または CacheDependency。

解説解説

AddCacheDependency メソッド使用すると、キャッシュされた応答CacheDependency オブジェクトとの間の依存関係作成できます

使用例使用例

AddCacheDependency メソッドCacheDependency オブジェクト使用してキャッシュ依存関係作成する方法次のコード例示します

<%@ Page Language="VB" %>
<%@ outputcache duration="30" varybyparam="none"
 %>

<script runat="Server">
    Sub Page_Load()
        ' Create a Cache Dependency 
        ' using a CacheDependency object.
        Dim authorsDependency("authors.xml")
 As CacheDependency

        ' Make the page invalid if either of the
        ' cached items change or expire.        
        Response.AddCacheDependency(authorsDependency)

        ' Display the current time for cache reference
        lblOutputCacheMsg.Text = DateTime.Now.ToString()
        
        
    End Sub
</script>

<html>
<head>
    <title>Cache Dependencies</title> 
</head>
<body>
    <form id="Form1" method="post"
 runat="server">
        <table>
            <tbody>
                <tr>
                    <td style="WIDTH: 118px">
                        The page was generated at:</td>
                    <td>
                        <asp:Label id="lblOutputCacheMsg"
 runat="server"></asp:Label>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</body>
</html>
<%@ Page Language="C#" %>
<%@ outputcache duration="30" varybyparam="none" %>

<script runat="Server">
    private void Page_Load(object sender, System.EventArgs
 e)
    {
        // Create a Cache Dependency 
        // using a CacheDependency object.
        CacheDependency authorsDependency = new CacheDependency("authors.xml");


        // Make the page invalid if either of the
        // cached items change or expire.        
        Response.AddCacheDependency(authorsDependency);

        // Display the current time for cache reference
        lblOutputCacheMsg.Text = DateTime.Now.ToString();
    }

</script>

<html>
<head>
    <title>Cache Dependencies</title> 
</head>
<body>
    <form id="Form1" method="post" runat="server">
        <table>
            <tbody>
                <tr>
                    <td style="WIDTH: 118px">
                        The page was generated at:</td>
                    <td>
                        <asp:Label id="lblOutputCacheMsg" runat="server"></asp:Label>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

HttpResponse.AddCacheDependency メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



HttpResponse.AddCacheDependency メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS