开发者

How to use I use Zend_Cache_Backend_TwoLevels with tagging?

开发者 https://www.devze.com 2023-02-03 03:10 出处:网络
I\'m thinking of using two level cache backend, in a Zend Framework application. Fast: APC Slow: File But I need it to use cache tagging, to make an easy cache clearing.

I'm thinking of using two level cache backend, in a Zend Framework application.

  1. Fast: APC
  2. Slow: File

But I need it to use cache tagging, to make an easy cache clearing. So is it possible? to use those combinations?

PS. I'm asking this question be开发者_如何学JAVAcause I've read:

Be careful : with this backend, "tags" are not supported for the moment as the "doNotTestCacheValidity=true" argument.

In the official Zend Framework document: Zend Cache APC Backend, so I was wondering how to get use of tags, since it's the most interesting part in caching IMO.


I don't think this is possible. You marked Mikushi's answer correct, however from this page:

http://framework.zend.com/manual/en/zend.cache.backends.html#zend.cache.backends.memcached

Be careful : with this backend, "tags" are not supported for the moment as the "doNotTestCacheValidity=true" argument.


Well, the documentation is pretty clear on that, APC does not support tagging. If you want to take advantage of the tagging and the two level caching, your might want to use Memcache as fast, then you'll have tagging available.

You could still hack your way in adding support for tagging to the APC BackEnd of Zend, by extending it, but i would not recommend it.

As a general advice, using APC as a main caching system is not a good solution. APC is mainly an OPcode cache system, even with the apc_store, whereas Memcache is a distributed caching system, which is a lot better, and safer.

To give you a "real life" example, at my job, we use APC as a cache only to store parsed configuration files for our websites/application. Everything else is either Redis or Memcache.

0

精彩评论

暂无评论...
验证码 换一张
取 消