ahcheqiu 发表于 2015-5-22 13:26:52

cache里面memcache和file的increment表现不一致的问题

memcache里面的increment方法调用的是php扩展里面的increment方法,会在提供的ID不存在时返回false
而用CI提供的file做缓存时,如果ID不存在会直接生成该ID的缓存,并把ttl设置成60,data设置为1,返回save的结果
另外,file不管在save时是否使用rawdata保存,都能使用increment

所以如果是load->driver('cache', array('adapter' => 'memcached', 'backup' => 'file'))的情况,还是老老实实用get吧
被坑到了
页: [1]
查看完整版本: cache里面memcache和file的increment表现不一致的问题