キャッシュ オブジェクトのフェッチまたはキャッシュへの保存を無効にするには、オプションcaching
を に設定しますfalse
。
オブジェクトを使用して、次のことができます。
$cacheObj = Zend_Registry::get('cacheObj');
if ($cacheObj instanceof Zend_Cache_Core) {
$cacheObj->setOption('caching', false);
}
これを自動化するには、これを行うコントローラー プラグインを作成します。次に例を示します。
<?php
class Application_Plugin_DisableCache extends Zend_Controller_Plugin_Abstract
{
public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
{
$module = $request->getModuleName();
// change 'dont_cache_me' to the module you want to disable caching in
if ('dont_cache_me' == $module) {
$cacheObj = Zend_Registry::get('cacheObj');
if ($cacheObj instanceof Zend_Cache_Core) {
$cacheObj->setOption('caching', false);
}
}
}
}