apollo11/yii2-behaviors
Composer 安装命令:
composer require apollo11/yii2-behaviors
包简介
Collection of global helper behaviors for Yii2 Framework
README 文档
README
Global Page Cache Behavior
Following behavior gives you the ability to enable Yii2 PageCache globally from config. Copy the following config to your respective config file.
... 'as globalCache' => [ 'class' => '\apollo11\behaviors\behaviors\GlobalPageCacheBehavior', 'rules' => [ [ 'controller' => 'about', 'actions' => ['index', 'main'], 'except' => ['view'], 'duration' => 70, 'variations' => [ \apollo11\behaviors\behaviors\GlobalPageCacheBehavior::VARIATION_BY_LANGUAGE, \apollo11\behaviors\behaviors\GlobalPageCacheBehavior::VARIATION_BY_URL, ], ] ] ], ...
| Param | Value |
| Controller | String : Controller ID : Required |
| Duration | Integer : Cache duration in seconds : Optional : Default - 60 seconds |
| Actions | Array : Action IDs to cache: Required : '*' - for all actions |
| Except | Array : Action IDs to skip cache on : Optional |
| Variations | Array : Strings for respective vartiations of caching : Optional |
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2019-04-25