<span id="pfnzv"></span>
      <form id="pfnzv"><span id="pfnzv"></span></form><address id="pfnzv"><span id="pfnzv"><nobr id="pfnzv"></nobr></span></address>
      <form id="pfnzv"><dfn id="pfnzv"><listing id="pfnzv"></listing></dfn></form>

        <sub id="pfnzv"><address id="pfnzv"></address></sub>
          <address id="pfnzv"><form id="pfnzv"><listing id="pfnzv"></listing></form></address>
          <address id="pfnzv"><address id="pfnzv"><nobr id="pfnzv"></nobr></address></address>

            <address id="pfnzv"></address>
            0712-2888027 189-8648-0214
            微信公眾號

            孝感風信網絡科技有限公司微信公眾號

            當前位置:主頁 > 技術支持 > PHP > laravel擴展包renatomarinho/laravel-page-speed 壓縮HTML加速網頁響應

            laravel擴展包renatomarinho/laravel-page-speed 壓縮HTML加速網頁響應

            時間:2024-08-22來源:風信官網 點擊: 1152次
            壓縮 HTML 加速網頁響應—— renatomarinho/laravel-page-speed,擴展包可以自動的優化網站,將HTML加速輸出顯示在客戶端瀏覽器。
             
            項目地址:https://github.com/renatomarinho/laravel-page-speed
             
            安裝命令:
             
            $ composer require renatomarinho/laravel-page-speed
             
            擴展包中使用了中間件
             
            //app/Http/Kernel.php
             
            protected $middleware = [
                ...
                \RenatoMarinho\LaravelPageSpeed\Middleware\InlineCss::class, //轉變html中的行內樣式
                \RenatoMarinho\LaravelPageSpeed\Middleware\ElideAttributes::class, //去除html中多余的屬性
            \RenatoMarinho\LaravelPageSpeed\Middleware\TrimUrls::class,  //去除html中所有的協議部分http或https,
                \RenatoMarinho\LaravelPageSpeed\Middleware\InsertDNSPrefetch::class,  //檢測html中所有的鏈接,并進行預加載
                \RenatoMarinho\LaravelPageSpeed\Middleware\RemoveComments::class,  //去除html中所有的注釋信息   
                \RenatoMarinho\LaravelPageSpeed\Middleware\RemoveQuotes::class, //去除html標簽中的引號
                \RenatoMarinho\LaravelPageSpeed\Middleware\CollapseWhitespace::class,  //去除html中所有的換行、空格等信息
            ]
             
            注意:響應式中間件的讀取順序是從下向上。
             
            我們將中間件注冊在web,所有通過web訪問的數據都可以進行壓縮
             
            protected $middlewareGroups = [
                    'web' => [
                        \App\Http\Middleware\EncryptCookies::class,
                        \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
                        \Illuminate\Session\Middleware\StartSession::class,
                        // \Illuminate\Session\Middleware\AuthenticateSession::class,
                        \Illuminate\View\Middleware\ShareErrorsFromSession::class,
                        \App\Http\Middleware\VerifyCsrfToken::class,
                        \Illuminate\Routing\Middleware\SubstituteBindings::class,
             
                        //壓縮 HTML 加速網頁響應—— renatomarinho/laravel-page-speed
                        \RenatoMarinho\LaravelPageSpeed\Middleware\InlineCss::class,
                        \RenatoMarinho\LaravelPageSpeed\Middleware\ElideAttributes::class,
            \RenatoMarinho\LaravelPageSpeed\Middleware\TrimUrls::class,
                        \RenatoMarinho\LaravelPageSpeed\Middleware\InsertDNSPrefetch::class,
                        \RenatoMarinho\LaravelPageSpeed\Middleware\RemoveComments::class,            
                        \RenatoMarinho\LaravelPageSpeed\Middleware\RemoveQuotes::class,
                        \RenatoMarinho\LaravelPageSpeed\Middleware\CollapseWhitespace::class,
                    ],
             
                    'api' => [
                        'throttle:60,1',
                        'bindings',
                    ],
                ];
            欄目列表
            推薦內容
            熱點內容
            展開
            国产精久久久久无码AV动漫|最新亚洲精品国偷自产在线|2021亚洲色中文字幕在线|最新无码av中文字专区 情欲美妇紧致敏感 国产免费AⅤ片在线播放 人妻爽爽免费在线视频 51精品国产人成在线观看 色偷偷av一区二区三区
            <span id="pfnzv"></span>
                <form id="pfnzv"><span id="pfnzv"></span></form><address id="pfnzv"><span id="pfnzv"><nobr id="pfnzv"></nobr></span></address>
                <form id="pfnzv"><dfn id="pfnzv"><listing id="pfnzv"></listing></dfn></form>

                  <sub id="pfnzv"><address id="pfnzv"></address></sub>
                    <address id="pfnzv"><form id="pfnzv"><listing id="pfnzv"></listing></form></address>
                    <address id="pfnzv"><address id="pfnzv"><nobr id="pfnzv"></nobr></address></address>

                      <address id="pfnzv"></address>