PHP 内容缓存 Yac

码农软件 · 软件分类 · 缓存系统 · 2019-08-30 08:27:32

软件介绍

Yac 是为PHP实现的一个基于共享内存, 无锁的内容Cache

Yac的两个应用场景:
1.让PHP进程之间共享一些简单的数据
2.高效地缓存一些页面结果

假设PHP以PHP-FPM运行,Yac和Pcache缓存的用户内容User Cache就像Opcache一样,保存在PHP-FPM占用的内存中,下一次脚本可以直接从PHP-FPM中读取数据,httpd_mod-php同理,而Memcached/Redis需要通过网络(端口)才能访问数据.简而言之,PHP加上Yac和Pcache这些PECL扩展后,自身就是一个K/V缓存系统,用起来很方便.

要求:PHP 5.2 +

安装:

$/path/to/phpize
$./configure --with-php-config=/path/to/php-config
$make && make install

限制:

  1. 缓存的键长度不超过 48 字节

  2. 缓存值不能超过 60 兆字节

  3. 压缩后的缓存值不能超过 1M

示例代码:

set("foo", "bar");
$yac->set(
    array(
        "dummy" => "foo",
        "dummy2" => "foo",
        )
    );
?>

Yac::get(array|string $key)

本文地址:https://www.codercto.com/soft/d/13478.html

Weaving the Web

Weaving the Web

Tim Berners-Lee / Harper Paperbacks / 2000-11-01 / USD 15.00

Named one of the greatest minds of the 20th century by Time , Tim Berners-Lee is responsible for one of that century's most important advancements: the world wide web. Now, this low-profile genius-wh......一起来看看 《Weaving the Web》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

html转js在线工具
html转js在线工具

html转js在线工具