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

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

WBOY
WBOYOriginal
2016-06-13 12:16:551431browse

怎么及时更新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的触发器弄,自己谷歌方法~
Statement:
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