enikeishik / cachewholepage
CacheWholePage 包用于 Laravel 框架 - 允许缓存整个页面的输出。
dev-main
2021-10-16 06:41 UTC
Requires
- php: ^7.4
- laravel/framework: ^7.0
This package is auto-updated.
Last update: 2024-09-16 13:11:03 UTC
README
用于 Laravel 框架 的包 - 允许缓存整个页面的输出。
要求
- PHP >= 7.4
- Laravel >= 7.0
安装
通过 composer 安装(或更新)包
composer require enikeishik/cachewholepage
确保自动加载将被更改
composer dump-autoload
通过 artisan 发布包
php artisan vendor:publish --provider="Enikeishik\CacheWholePage\ServiceProvider"
此命令将配置文件复制到对应的项目文件夹。
安装后
默认情况下,缓存应用于 web
组中的所有路由。可以在服务提供程序中更改。
在 env
文件中调整配置参数 CACHE_WP_TTL
(或在项目配置文件夹中 cachewholepage.php
文件中的 ttl
参数)以适应您的需求。
将路径的第一个段添加到项目配置文件夹中 cachewholepage.php
文件中的 excludes
数组以避免缓存。
缓存和锁的 TTL 应明显大于页面生成时间的估计值。