`
dcj3sjt126com
  • 浏览: 1831103 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

yii2开启表结构缓存

    博客分类:
  • Yii2
阅读更多

因为当运用模型(model)时,AR的一些公共属性都会从DB中获取,这样会导致服务器负担一些额外的资源开销,实际上对于成品来说,服务器这些开始销是多余的,故应该阻止这种默认行为

 

开启schema缓存:

'db'=>array( 
    ... 
    'enableSchemaCache' => true,
    'schemaCacheDuration'=>86400, // time in seconds 
    ... 
), 

 参考地址: http://blog.csdn.net/yuhui_fish/article/details/11608219

http://www.yiichina.com/doc/api/2.0/yii-db-command

http://www.larryullman.com/2010/06/28/caching-the-database-schema-using-memcached-with-yii/

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics