tje3d / html-minify
最小化Laravel 5应用程序的HTML输出(最初来自 https://github.com/fitztrev/laravel-html-minify)
1.0.1
2017-04-30 23:02 UTC
Requires
- php: >=5.6.0
- illuminate/support: 5.x
This package is not auto-updated.
Last update: 2024-09-29 03:52:39 UTC
README
此包最初来自 https://github.com/fitztrev/laravel-html-minify,我已更新包使其与Laravel 5兼容。我分叉并简化了它 😁
关于
此包压缩了您的Laravel 5应用程序的HTML输出,无缝减少页面总体响应大小。
我看到的其它脚本会为每个请求实时压缩HTML输出。相反,此包扩展了Blade编译器,将编译后的模板文件以压缩状态保存到磁盘上,减少每个请求的开销。
为什么?
即使启用了gzip,HTML内容类型的文档响应大小仍有改进。
安装
- composer require tje3d/html-minify
- 将
Tje3d\HtmlMinify\HtmlMinifyServiceProvider::class
添加到 config/app.php 中 providers 列表。 - 使用
php artisan vendor:publish
命令发布您的配置 - php artisan view:clear
选项
enabled
- 布尔值,默认 true