This tells Smarty whether or not to cache the output of the templates. By default this is set to 0, or disabled. If your templates generate redundant redundant content, it is advisable to turn on caching. This will result in significant performance gains. You can also have multiple caches for the same template. A value of 1 or 2 enables caching. 1 tells Smarty to use the current $cache_lifetime variable to determine if the cache has expired. A value of 2 tells Smarty to use the cache_lifetime value at the time the cache was generated. This way you can set the cache_lifetime just before fetching the template to have granular control over when that particular cache expires. See also is_cached.
此變數在設定 Smarty 是否要快取住樣版的輸出,預設狀況下此變數的值為0,或 disabled。如果你的樣版產生出相當多的多餘內容的話,建議是開啟快取,此舉將會獲取相當大 的效能改善。你也可以對同一個樣版作多次的快取。值是1或2的話都能開啟快取。1的話是告訴 Smarty 使用現在的 $cache_lifetime 變數決定是否快取已經過期。2的話是告訴 Smarty 在快 取產生時使用 cache_lifetime 的值。如此一來你可以在取得樣版檔案前設定 cache_lifetime 的值,特別是在快取過期的情況下,也可取得對樣版的控制權。請參閱 is_cached。
If $compile_check is enabled, the cached content will be regenerated if any of the templates or config files that are part of this cache are changed. If $force_compile is enabled, the cached content will always be regenerated.
如果 $compile_check 是開啟的話,只要此次快取內容的任何樣版檔案或組態檔案 改變話則快取內容都會被重新製作。如果 $force_compile 是開啟的話,則是一定會重新製作快 取的內容。