fastd / fastd-demo
Installs: 413
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:project
Requires
- php: >=5.6
- fastd/fastd: ^3.2
- fastd/viewer: ^0.1.0
Requires (Dev)
- phpunit/dbunit: ^2.0
This package is not auto-updated.
Last update: 2024-11-01 08:37:29 UTC
README
1.安装 正式包 composer require fastd/cache-provider (暂时不能用 by.2018-06-29) 开发包 composer require "fastd/cache-provider:dev-master"
2.安装完成之后,修改配置文件 config/app.php 找到 services增加 \FastD\CacheProvider\CacheServiceProvider::class,如下示例
'services' => [
\FastD\ServiceProvider\RouteServiceProvider::class,
\FastD\ServiceProvider\LoggerServiceProvider::class,
\FastD\ServiceProvider\DatabaseServiceProvider::class,
\FastD\ServiceProvider\CacheServiceProvider::class,
\FastD\ServiceProvider\MoltenServiceProvider::class,
\ServiceProvider\HelloServiceProvider::class,
\FastD\Viewer\Viewer::class,
\FastD\CacheProvider\CacheServiceProvider::class,//新增的在此,上面的与此无关
],
3.设置页面缓存时长【此步可选,不设置默认60秒】 config/config.php 修改或增加 common.cache.lifetime ,代码示例如下
return [
'common' => [
'cache' => [
'lifetime' => 60
],
],
];
注:只针对GET请求正常响应码为200的页面有缓存; 完成;