【发布时间】:2015-02-05 12:48:09
【问题描述】:
我正在使用 bramstroker 的 StrokerCache Zend Framework 2 模块,它本身使用 Zend\Cache 并具有方法 clearByTags()。
如果我想清除缓存,以下工作正常:
public function fooAction()
{
$cs = $this->getServiceLocator()->get('strokercache_service');
var_dump($cs->clearByTags(array(
'controller_ClientCms\Controller\Cms'
)));
}
但是,如果我想包含参数怎么办?
$cs->clearByTags(array(
'controller_ClientCms\Controller\Cms,param_action:index,param_client:foo'
));
...不起作用。
缓存目录中的标记文件如下所示:
strokercache_route_home/client
strokercache_controller_ClientCms\Controller\Cms
strokercache_param_action_index
strokercache_param_client_foo
【问题讨论】:
-
我没有使用过该库,尽管文档说明您可以使用
param_<paramname>_<paramvalue>格式从缓存中清除参数,但是您的示例显示param_<paramname>:<paramvalue> -
谢谢,你的提示试过了,还是不行。
标签: php caching zend-framework2 zend-cache