?
このドキュメントでは、 php中國語ネットマニュアル リリース
This is the length of time in seconds that a template cache is valid.
Once this time has expired, the cache will be regenerated. $caching must
be set to "true" for $cache_lifetime to have any purpose. A value of -1
will force the cache to never expire. A value of 0 will cause the cache
to always regenerate (good for testing only, to disable caching a more
efficient method is to set $caching = false.)
該變量定義模板緩存有效時(shí)間段的長(zhǎng)度(單位秒),一旦這個(gè)時(shí)間失效,則緩存將會(huì)重新生成.如果要想實(shí)現(xiàn)所有效果,$caching必須因$cache_lifetime需要而設(shè)為"true".值為-1時(shí),將強(qiáng)迫緩存永不過期.0值將導(dǎo)致緩存總是重新生成(僅有利于測(cè)試,一個(gè)更有效的使緩存無效的方法是設(shè)置$caching
= false.)
If $force_compile is
enabled, the cache files will be regenerated every time, effectively
disabling caching. You can clear all the cache files with the clear_all_cache() function, or
individual cache files (or groups) with the clear_cache() function.
如果啟動(dòng)了強(qiáng)迫編譯,則緩存文件每次將會(huì)重新生成.要想有效地停止緩存,你可以利用clear_all_cache()
函數(shù)清除所有的緩存文件,或者利用clear_cache()
函數(shù)清除個(gè)別文件(或文件組).
Technical Note: If you want to give certain templates their own cache lifetime, you could do this by setting $caching = 2, then set $cache_lifetime to a unique value just before calling display() or fetch().
技巧:如果你想給某些模板設(shè)定它們自己的緩存生存時(shí)間,你可以在調(diào)用display()或fetch()函數(shù)之前,通過設(shè)置$caching = 2,然后設(shè)置$cache_lifetime為一個(gè)唯一值來實(shí)現(xiàn).