我可以使用Magento的缓存层作为键/值存储吗? [英] Can I use Magento's Caching layer as a Key/Value Store?

查看:54
本文介绍了我可以使用Magento的缓存层作为键/值存储吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用Magento的缓存层作为类似于memcached或apc的键/值存储吗?能够不用担心正在使用哪种缓存引擎并且仍然缓存一些代码是很好的选择.

Can I use Magento's Caching layer as a Key/Value Store similar to memcached or apc? It be nice to be able to not worry what caching engine is being used and still cache some of the code.

在进一步说明中,我希望Magento在执行一些JOINS操作后缓存我的Collection.如果由于某种原因Magento不缓存联接的数据,我也想听听.

On a further note, I will expect Magento to cache my Collection after I do some JOINS with it. If for some reason Magento does not cache the joined data, I'd like to hear about that as well.

推荐答案

缓存可以直接用作键/值存储,
https://web.archive.org/web/20040328220156/http://www.nicksays.co.uk/2010/07/developers-guide-magento-cache/
(感谢 B00MER 用于

The cache can be used directly as a key/value store,
https://web.archive.org/web/20040328220156/http://www.nicksays.co.uk/2010/07/developers-guide-magento-cache/
(Thanks to B00MER for pointing this out)

块已经内置了一些缓存功能,您只需要提供密钥. 集合没有相同的技巧,但 MySQL确实有它自己的查询缓存,并且可能已经处于活动状态.最好使用块缓存,因为无论如何,您的集合通常最终都将以呈现的HTML格式出现.

Blocks already have some caching functionality built in, you just need to provide the key. Collections don't have the same trick but MySQL does have it's own query cache and may already be active. Block caching is preferred since your collection will often end up as rendered HTML anyway.


可以 对集合进行缓存,并且类似的块也需要一个缓存键.我以前没有做过,但大概它的工作原理完全一样.


Collections can be cached and like blocks need a cache key. I've not done it before but presumably it works exactly the same.

(它已经被问到了但未得到回答)

(It has been asked before but not answered)

这篇关于我可以使用Magento的缓存层作为键/值存储吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆