public function dailyRelays() {
$history = I('post.history');
$da = new \Home\Model\DailyrelayModel();
if (empty($history) || ($history == 0)) {//今日转发列表
$this->question = $da->getList(session('memberid'),0);
} else if ($history == 1) {//历史转发列表
$cache_name=md5(session('memberid'));
if(S($cache_name)){
G('begin');
$ssss = S($cache_name);
$this->question = $ssss;
G('end');
echo G('begin','end').'s'; }else{
G('begin');
$ssss = $da->getList(session('memberid'),1);
S($cache_name,$ssss,5);
$this->question = $ssss;
G('end');
echo G('begin','end').'s';
}
}
$this->memberid = session('memberid'); $this->display();
}

thinkphp+memcache缓存例子的更多相关文章

  1. ThinkPHP+Memcache的缓存方案总结

    简介: ThinkPHP用S()方法可以缓存数据,这在访问数据库时非常有用,可以在有限时间内当数据库无变化时从缓存取数据,有变化时从数据库取数据. Memcached+Memcache是一个将数据保存 ...

  2. ThinkPHP的缓存技术

    原文:ThinkPHP的缓存技术 如果没有缓存的网站是百万级或者千万级的访问量,会给数据库或者服务器造成很大的压力,通过缓存,大幅减少服务器和数据库的负荷.假如我们 把读取数据的过程分为三个层,第一个 ...

  3. Thinkphp关闭缓存方法总结(转)

    ThinkPHP在数据缓存方面包括文件方式.共享内存方式和数据库方式在内的多种方式进行缓存,通过插件方式还可以增加以后需要的缓存类,让应用开发可以选择更加适合自己的缓存方式,从而有效地提高应用执行效率 ...

  4. DedeCMS V5.7开启memcache缓存的方法配置说明

    一.安装Memcache服务:1.1.linux下的Memcache安装:-------------------------1. 下载 memcache的linux版本,注意 memcached 用 ...

  5. 详解PHP操作Memcache缓存技术提高响应速度的方法

    本文转载http://blog.csdn.net/zhihua_w  不错的博客,仅供本人学习之用 一般来说,如果并发量不大的情况,使不使用缓存技术并没有什么影响,但如果高并发的情况,使用缓存技术就显 ...

  6. php memcache 缓存与memcached 客户端的详细步骤

    缓存服务器有Memcache.Redis,我主要介绍了PHP中的Memcache,从Memcache简介开始,详细讲解了如Memcache和memcached的区别.PHP的 Memcache所有操作 ...

  7. thinkphp 数据缓存

    在ThinkPHP中进行缓存操作,一般情况下并不需要直接操作缓存类,因为系统内置对缓存操作进行了封装,直接采用S方法即可,例如: 缓存初始化 // 缓存初始化 S(array('type'=>' ...

  8. ThinkPHP 的缓存大概多久更新一次

    ThinkPHP 的缓存大概多久更新一次可以自己设置: thinkPHP的缓存默认是文件缓存,保存在Runtime文件夹里面, 如果不设置过期时间,且不清除Runtime文件,就会一直存在. 如果设置 ...

  9. 使用Memcache缓存mysql数据库操作的原理和缓存过程浅析

    转载自脚本之家 http://www.jb51.net/article/51831.htm  作者:忙碌的松鼠 对于大型网站如facebook,ebay等网站,如果没有Memcache做为中间缓存层, ...

随机推荐

  1. WARN deprecation:&L - HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-configuration. Use namespace http://www.hibernate.org/dtd/hibernate-configuration

    WARN deprecation:&L - HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sour ...

  2. martin/docker-cleanup-volumes

    https://hub.docker.com/r/martin/docker-cleanup-volumes/

  3. [OpenCV Qt教程] 如何在内存中压缩图像

    本文译自:http://www.robot-home.it/blog/en/software/tutorial-opencv-qt-comprimere-un-immagine-in-memoria/ ...

  4. __slots__

    __slots__ 由于Python是动态语言,任何实例在运行期都可以动态地添加属性. 如果要限制添加的属性,例如,Student类只允许添加 name.gender和score 这3个属性,就可以利 ...

  5. xe8 单元别名

    xe8 单元别名 Unit scope F2613 Unit 'Graphics' not found. Project>Option>Unit scope names> vcl.I ...

  6. e s6 知识点

    http://es6.ruanyifeng.com/#docs/reflect 1.资料对es6箭头函数中的this总结:箭头函数中的this指向的是 定义时的this,而不是 执行时的this.

  7. axis2 webService开发指南(1)

    参考文件:blog.csdn.net/IBM_hoojo http://hoojo.cnblogs.com/ 1 WebService简介 WebService让一个程序可以透明的调用互联网的程序,不 ...

  8. C# Attribute的用法

         {                   {                            Attribute[] atts = Attribute.GetCustomAttribut ...

  9. plsql程序中循环语句的使用

  10. 实现二叉树的基本操作(Java版)

    近期研究了一下二叉树,试着用Java语言实现了二叉树的基本操作,下面分享一下实现代码: package com.sf.test; import java.util.ArrayDeque; import ...