具有LRU到期的内存中缓存 [英] In-memory cache with LRU expiration

查看:96
本文介绍了具有LRU到期的内存中缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的PHP驱动的网站寻找内存缓存.它不是高流量的网站,我只想缓存数据和某些页面的某些部分以提高性能.数据大小从几字节到几kB不等.我目前正在使用xCache,并且没有问题.

I am looking for an in memory cache for my PHP powered website. It is not high traffic website, I just want to cache data and parts of some pages for improving performance. The data size will vary from a few bytes to few kBs. I am currently using xCache, and have no problem with it.

切换到内存缓存或Redis更好吗?有更好的选择吗?

Is it better to switch to memcached or redis? Are there any better options?

推荐答案

如果您没有任何明显的问题,为什么要立即切换?内存缓存或Redis可能更好,但是如果您现在不需要它们,最好保留它们.只要您的缓存策略是合理的,并且缓存接口是抽象的,那么当您真正需要切换到可伸缩缓存时,应该可以在以后添加它们.

If you don't have any obvious problem, why do wanna switch right now? Memcached or redis are probably better but if you don't need them right now, it is better to leave them. As long as your caching strategy is sound and cache interface is abstracted you should be able to add them later when you actually feel the need to switch to a scalable cache.

PHP中的xCache也是操作编码器缓存. redis或多或少像是proc键值对之列.如果您的站点在2台或3台服务器上运行,并且需要上下文b.w共享它们,而不仅仅是保留单个实例,那么这些缓存将有所帮助.

Also xCache in PHP is an opcoder cache.. Memcache & redis are more or less like a out of proc key Value pair.. If your site is running on 2 or 3 server and you need the context b.w them shared not just kept individual instances, those caches will help.

-赛

这篇关于具有LRU到期的内存中缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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