Welcome to the Cookbook

loading...

{JA} - 7.2 キャッシュ

キャッシュヘルパーはレイアウトやビューをキャッシュするのを助けてくれ、繰り返しデータを取得する際に時間を節約できます。Cake のビューキャッシングは一時的に解析したレイアウトやビューを選択したストレージエンジンに保存します。キャッシュヘルパーは他のヘルパーとはかなり異なった動作をすることに注意してください。直接呼び出せるメソッドはありません。代わりにビューはキャッシュタグでマーキングされ、コンテンツのブロックがキャッシュされていることを示します。

URL がリクエストされると、Cake はそのリクエストされた文字列がすでにキャッシュされているかどうかを確認します。もしキャッシュされてれば、ディスパッチプロセスの URL の残りをスキップします。キャッシュされていないブロックは通常通り処理され、ビューは動作します。このおかげでキャッシュされた URL への各リクエストは最小限のコードだけが実行されるので実行時間を大きく節約できます。Cake がキャッシュされたビューを見つけられない場合、あるいはキャッシュがリクエストされた URL の期限を過ぎている場合、通常通りリクエストを処理し続けます。

{EN} - 7.2 Cache

The Cache helper assists in caching entire layouts and views, saving time repetitively retrieving data. View Caching in Cake temporarily stores parsed layouts and views with the storage engine of choice. It should be noted that the Cache helper works quite differently than other helpers. It does not have methods that are directly called. Instead a view is marked with cache tags indicating which blocks of content should not be cached.

When a URL is requested, Cake checks to see if that request string has already been cached. If it has, the rest of the url dispatching process is skipped. Any nocache blocks are processed normally and the view is served. This creates a big savings in processing time for each request to a cached URL as minimal code is executed. If Cake doesn't find a cached view, or the cache has expired for the requested URL it continues to process the request normally.

差分

Lines: 1-3Lines: 1-3
-<title>Cache</title>
<p>The Cache helper assists in caching entire layouts and views, saving time repetitively retrieving data. View Caching in Cake temporarily stores parsed layouts and views with the storage engine of choice. It should be noted that the Cache helper works quite differently than other helpers. It does not have methods that are directly called. Instead a view is marked with cache tags indicating which blocks of content should not be cached.</p>
<p>When a URL is requested, Cake checks to see if that request string has already been cached. If it has, the rest of the url dispatching process is skipped. Any nocache blocks are processed normally and the view is served. This creates a big savings in processing time for each request to a cached URL as minimal code is executed. If Cake doesn't find a cached view, or the cache has expired for the requested URL it continues to process the request normally.</p>
+<title>キャッシュ</title>
<p>キャッシュヘルパーはレイアウトやビューをキャッシュするのを助けてくれ、繰り返しデータを取得する際に時間を節約できます。Cake のビューキャッシングは一時的に解析したレイアウトやビューを選択したストレージエンジンに保存します。キャッシュヘルパーは他のヘルパーとはかなり異なった動作をすることに注意してください。直接呼び出せるメソッドはありません。代わりにビューはキャッシュタグでマーキングされ、コンテンツのブロックがキャッシュされていることを示します。</p>
<p>URL がリクエストされると、Cake はそのリクエストされた文字列がすでにキャッシュされているかどうかを確認します。もしキャッシュされてれば、ディスパッチプロセスの URL の残りをスキップします。キャッシュされていないブロックは通常通り処理され、ビューは動作します。このおかげでキャッシュされた URL への各リクエストは最小限のコードだけが実行されるので実行時間を大きく節約できます。Cake がキャッシュされたビューを見つけられない場合、あるいはキャッシュがリクエストされた URL の期限を過ぎている場合、通常通りリクエストを処理し続けます。</p>