Home > Backend Development > PHP Tutorial > memcached的施用技巧

memcached的施用技巧

WBOY
Release: 2016-06-13 12:42:50
Original
825 people have browsed it

memcached的使用技巧
请问下你们是怎么使用这个缓存系统的,如果每个功能,都是先判断memcache里有没有缓存,如果有直接拿,没有就先写入到memcached吗?
那么代码化就是:
if(!memcache){
   写入数据memcached
}else{
   直接从memcached拿数据
}

现在的问题是,如果每个功能,每个模块,都先来判断memcached,会不会很麻烦啊,有没有什么好的架构方法吗?

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