<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFCACHE</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="説明">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFCACHE</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">説明</span>
<p>
ページのコピーをサーバーコンピュータまたはクライアントコンピュータに保管して、ページレンダリングのパフォーマンスを向上させます。これを行うために、このタグでは、ColdFusion ページにより返されたスタティック HTML が含まれるテンポラリファイルが作成されます。
</p>

<p>
このタグは、ユーザーがページにアクセスするたびにダイナミックコンテンツを取り込む必要がない場合に使用します。 
</p>

<p>
単純な URL や、URL パラメータを含む URL に対して、このタグを使用できます。
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">カテゴリ</span>
<p>
ページ処理タグ
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">シンタックス</span><pre>&lt;cfcache
   action = &quot;action&quot;
   directory = &quot;directory_name&quot;
   timespan = &quot;value&quot;
   expireURL = &quot;wildcarded_URL_reference&quot;
   username = &quot;username&quot;
   password = &quot;password&quot;
   port = &quot;port_number&quot;
   protocol = &quot;protocol&quot;&gt;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">関連項目</span>
<p>
cfflush、cfheader、cfhtmlhead、cfsetting、cfsilent
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">ヒストリ</span>
<p>
ColdFusion&#160;MX: 
</p>
<ul>

<li>cachedirectory 属性および timeout 属性は使用禁止になりました。これらの属性は今後のリリースでは機能せず、エラーが発生する可能性があります。 </li>

<li>timespan 属性が追加されました。 </li>

<li>ページのキャッシュ方法が変更されました。action 属性のデフォルト値である cache を使用すると、サーバー上とクライアント上でページがキャッシュされます (以前のリリースでは、このオプションを使用した場合、サーバー上のみでページがキャッシュされていました)。 </li>

<li>protocol と port の値のソースが変更されました。protocol および port のデフォルト値は、現在のページの URL から取得されます (以前のリリースでは、これらの値はそれぞれ、&quot;http&quot; と &quot;80&quot; でした)。 </li>

<li>ページをキャッシュするときのセッションステートの扱い方が変更されました。このタグでは、ColdFusion のログインにより安全が確保されているページなど、セッションステートに依存したページをキャッシュすることができます (以前のリリースでは、ページがキャッシュされるとセッションステートがクリアされていたため、認証が失われる原因となっていました)。</li>

<li>ファイルのキャッシュ方法が変更されました。このタグでは、ファイルをキャッシュするファイル名に URL の hash() が使用されます (以前のリリースでは、&quot;cfcache.map&quot; ファイルが使用されていました)。</li>
</ul>

<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">使用方法</span>
<p>
このタグは、コンテンツが頻繁に更新されないページで使用します。このアクションを実行すると、ユーザーが使用するアプリケーションのパフォーマンスが大幅に向上します。
</p>

<p>
キャッシュされたページの出力は、クライアントのブラウザまたは ColdFusion サーバー上のファイルに保管されます。ColdFusion では、ページの出力がリクエストされるたびにそれを再生成してダウンロードするのではなく、キャッシュされた出力を使用します。ColdFusion では、timespan 属性の指定、または cfcache action=flush の呼び出しによってキャッシュがフラッシュされる場合にのみ、ページが再生成され、ダウンロードされます。
</p>

<p>
単純な形式でのキャッシュ機能を有効にするには、timespan 属性を指定した cfcache タグをページの先頭に挿入します。ColdFusion により、指定時間が経過するごとに、キャッシュからページのコピーがフラッシュ (削除) され、新しいコピーがキャッシュされて、ユーザーからのアクセスに備えられます。
</p>

<p>
action 属性を使用すると、クライアントサイドでのキャッシュを指定することも、クライアントサイドとサーバーサイド両方でのキャッシュ (デフォルト) を指定することもできます。クライアントサイドでのキャッシュの利点は、ColdFusion のリソースが必要ないという点です。ここではブラウザ自身のキャッシュにページが保管され、パフォーマンスが高められます。クライアントサイドとサーバーサイド両方でのキャッシュの利点は、サーバーのパフォーマンスを最適化できるという点です。たとえば、ブラウザにページのキャッシュがない場合、サーバーは自身のキャッシュからデータを取得することができます。Macromedia では、サーバーサイドのみのキャッシュはお勧めしません。クライアントサイドとサーバーサイド両方でのキャッシュをお勧めします。
</p>

<p>
個人用のコンテンツが含まれているページの場合、action = &quot;clientcache&quot; オプションを使用すると、個人用のページのコピーが他のユーザー用にキャッシュされるおそれがなくなります。
</p>

<p>
アプリケーションページでデバッグが有効にされていないかぎり、デバッグを設定しても cfcache では無効になります。キャッシュファイルの生成時、cfcache では cfsetting showDebugOutput = &quot;no&quot; が使用されます。
</p>

<p>
cfcache タグでは、URL パラメータを含む固有の URL それぞれが、キャッシュを行うための独立したページとして評価されます。たとえば、http://server/view.cfm?id=1 の出力と http://server/view.cfm?id=2 の出力は別々にキャッシュされます。
</p>

<p>
cfcache タグでは、cfhttp タグを使用してキャッシュするページのコンテンツが取得されます。ページへのアクセス中に HTTP エラーが発生した場合、コンテンツはキャッシュされません。ColdFusion エラーが発生すると、そのエラーがキャッシュされます。
</p>

<p>
詳細については、『ColdFusion MX 開発ガイド』の第13章の「ColdFusion アプリケーションの最適化」 の「変更頻度の低い ColdFusion ページのキャッシュ」を参照してください。
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">例</span><pre>&lt;!--- この例では、URL パラメータの順列と同じ数だけ、
キャッシュファイルが作成されます。タイムスタンプが変わらないときに、ページが
キャッシュされていることがわかります。---&gt;

&lt;cfcache
timespan=&quot;#createTimeSpan(0,0,10,0)#&quot;&gt;
&lt;body&gt;

&lt;h3&gt;簡単な出力のテスト&lt;/h3&gt;

&lt;cfoutput&gt;
このページは次の時刻に生成されました : #now()#&lt;br&gt;
&lt;/cfoutput&gt;

&lt;cfparam name = &quot;URL.x&quot; default = &quot;no URL parm passed&quot; &gt;
&lt;cfoutput&gt;URL.x の値は # URL.x # です。&lt;/cfoutput&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="ACTION">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">ACTION</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "cache"

<ul>

<li>cache: サーバーサイドおよびクライアントサイトでのキャッシュです。</li>

<li>flush: キャッシュされたページを更新します。 </li>

<li>clientcache: ブラウザサイドのみのキャッシュです。個人用ページをキャッシュする場合に、このタグを使用します。</li>

<li>servercache: サーバーサイドのみのキャッシュです。この値は推奨されません。</li>

<li>optimal: &quot;cache&quot; と同様です。 </li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="DIRECTORY">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">DIRECTORY</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "cf_root/cache"


<p>キャッシュディレクトリの絶対パスです。 </p>

  </td>
  </tr>
  </table>
</div>
<div id="TIMESPAN">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">TIMESPAN</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "cfcache action = &quot;flush&quot; が実行されたときにのみ更新されます。"


<p>キャッシュからページがフラッシュされるまでの間隔です。 </p><ul>

<li>10 進数で表した日数。例 : </li>
<ul>

<li>	- 4 分の 1 日 (6 時間) の場合、「.25」と指定します。</li>

<li>	- 1 日の場合は「1」と指定します。</li>

<li>	- 1 日半の場合は「1.5」と指定します。</li>
</ul>

<li>CreateTimeSpan 関数の戻り値です。例 : &quot;#CreateTimeSpan(0, 6, 0, 0)#&quot;</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="EXPIREURL">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">EXPIREURL</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "キャッシュされているページすべてを更新します。"


<p>action = &quot;flush&quot; と共に使用します。URL へのリファレンスです。ColdFusion により、URL が指定されたキャッシュディレクトリ内のマッピングと照合されます。ワイルドカードを指定できます。例 : &quot;*/view.cfm?id=*&quot; </p>

  </td>
  </tr>
  </table>
</div>
<div id="USERNAME">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">USERNAME</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>ユーザー名です。ページに Web サーバーレベルの認証が必要な場合に、この属性を指定します。</p>

  </td>
  </tr>
  </table>
</div>
<div id="PASSWORD">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">PASSWORD</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>パスワードです。ページに Web サーバーレベルの認証が必要な場合に、この属性を指定します。</p>

  </td>
  </tr>
  </table>
</div>
<div id="PORT">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">PORT</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "現在表示しているページのポート"


<p>URL をリクエストしている Web サーバーのポート番号です。ColdFusion では、cfcache から cfhttp への内部呼び出しにおいて、ページ内の各 URL 変数が変換されます。これにより、ページ内のそのリンクの有効性を保つことができます。 </p>

  </td>
  </tr>
  </table>
</div>
<div id="PROTOCOL">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">PROTOCOL</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "現在表示しているページのプロトコル"


<p>キャッシュから URL を作成するときに使用するプロトコル</p><ul>

<li>http://</li>

<li>https://</li>
</ul>


  </td>
  </tr>
  </table>
</div>

  </body>
</html>
