Zend_Cache 與 Memcache Backend

Zend_Cache 是我一開始用 Zend Framework 的主因之一,除了包裝的不錯,使用 tag 的概念也讓我很在意:

Caching in Zend Framework is operated by frontends while cache records are stored through backend adapters (File, Sqlite, Memcache...) through a flexible system of IDs and tags. Using those, it is easy to delete specific types of records afterwards (for example: "delete all cache records marked with a given tag").

如果 cache 可以用 tag 處理的話,cache invalidate 的管理上會變得非常的容易。

用 File Backend 測了一下 tag 的功能發現沒什麼問題,但一直想不太出來在 Memcache 上面要怎麼實做 (而且要 atomic),後來實際拿 Memcache Backend 測了以後發現 tag 的功能在 Memcache Backend 上面不支援,翻了翻 source code 也確定了這件事情 XD

最近有人在 mailing list 上提到 memcached-tag 這個子計畫,看起來是有關係的 :p

Leave a Reply

Your email address will not be published. Required fields are marked *