Home > Backend Development > PHP Tutorial > 如何及时更新Memcache缓存的内容

如何及时更新Memcache缓存的内容

WBOY
Release: 2016-06-13 12:16:55
Original
1483 people have browsed it

怎么及时更新Memcache缓存的内容

本帖最后由 liaohongchu 于 2014-09-09 10:13:24 编辑
//连接
$mem = new Memcache;
$mem->connect("127.0.0.1", 11211);

$data="读取数据库的新闻列表内容";

//保存数据
$mem->set('key1', $data 0, 3600);
$val = $mem->get('key1');
echo "Get key1 value: " . $val ."
";

//关闭连接
//$mem->close();

?>

怎么更新Memcache 缓存的内容?

------解决思路----------------------
用mysql的触发器弄,自己谷歌方法~
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template