Optimize Laravel website speed
- 2021年3月01日
- 技術情報
Today, I would like to highlight a laravel package that will hep you to speed up your laravel website.
It is very important for every website to quick load that means your website should load in few seconds like 4 or 5. We are always fetching issues about page speed like how to increase website speed in laravel, how to reduce loading time of website in laravel, is it possible speed up php execution time of my website, how to optimize php laravel script to increase speed, how to speed up web browsing in laravel. So basically you have several question regarding to improve your website performance.
I found “laravel-page-speed” composer package for 35%+ optimization of laravel website. laravel-page-speed package will minify HTML output and it can be optimization your web page. laravel-page-speed package will delete unused attributes in HTML tags, delete unused quotes in HTML tags, delete unused prefixes from URLs, delete unused whitespace in HTML, delete HTML comments. Also there are several feature. They also minify css and minify js files.
Just grab the package via composer.
 composer require renatomarinho/laravel-page-speedPublish the configuration file
php artisan vendor:publish --provider="RenatoMarinho\LaravelPageSpeed\ServiceProvider"And then register it in Kernel file
//app/Http/Kernel.php
protected $middleware = [
    ...
    \RenatoMarinho\LaravelPageSpeed\Middleware\InlineCss::class,
    \RenatoMarinho\LaravelPageSpeed\Middleware\ElideAttributes::class,
    \RenatoMarinho\LaravelPageSpeed\Middleware\InsertDNSPrefetch::class,
    \RenatoMarinho\LaravelPageSpeed\Middleware\RemoveComments::class,
    //\RenatoMarinho\LaravelPageSpeed\Middleware\TrimUrls::class, 
    //\RenatoMarinho\LaravelPageSpeed\Middleware\RemoveQuotes::class,
    \RenatoMarinho\LaravelPageSpeed\Middleware\CollapseWhitespace::class, // Note: This middleware invokes "RemoveComments::class" before it runs.
    \RenatoMarinho\LaravelPageSpeed\Middleware\DeferJavascript::class,
]And you are good to go.
There are several useful filtering methods that will help you to speed up your website like `RemoveComments, CollapseWhitespace, RemoveQuotes` etc.
You can see more detail in their documentation.
By Yuuma
yuuma at 2021年03月01日 11:00:13

 大人が楽しめるヒーリング絵本河童のカパと静かな森
大人が楽しめるヒーリング絵本河童のカパと静かな森 パワースポット 日本三大神滝布引の滝
パワースポット 日本三大神滝布引の滝 佐藤・広幸ドイツ魂
佐藤・広幸ドイツ魂 Himeji Castle姫路城
Himeji Castle姫路城 ボイドタイムお知らせアプリVoid Time 〜月を無視できない〜
ボイドタイムお知らせアプリVoid Time 〜月を無視できない〜 撮った写真をカレンダーに撮りカレ
撮った写真をカレンダーに撮りカレ ライブ壁紙竹田城ライブ壁紙
ライブ壁紙竹田城ライブ壁紙 赤ちゃんにっこりBaby+Smile
赤ちゃんにっこりBaby+Smile 電子書籍[for iPhone]ターラのアストロロジー
電子書籍[for iPhone]ターラのアストロロジー JSpreadsheet カラム設定Tips
									JSpreadsheet カラム設定Tips