gpt4 book ai didi

php - GZIP 压缩不适用于 Wordpress 网站

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:36:04 24 4
gpt4 key购买 nike

我正在用 wordpress 实现一个网站。当我在谷歌页面速度上测试我的网站时,它看起来很糟糕。我遇到了一些压缩问题。

    Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yK/r/XVnmkWxbmyb.js could save 152KiB (74% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yz/r/7emJbLsMYck.js could save 123.6KiB (72% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yY/r/MYnSaHkqljr.js could save 121.7KiB (70% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yh/r/Sst4Eu6wCBO.js could save 69.3KiB (70% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/y6/r/luizkbRWOQS.js could save 24.2KiB (67% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yI/r/oDzewPwhRt1.js could save 21.7KiB (74% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yP/r/gcdIMTVPpBq.css could save 17.3KiB (77% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yf/r/nrh6Sehx1Iz.css could save 15.4KiB (73% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yV/r/1pZAFn_KQPn.css could save 14.2KiB (74% reduction).
Compressing http://www.advancebestmaid.com.sg/ could save 12.7KiB (72% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/ya/r/acNHHHLf-Ph.js could save 11.3KiB (69% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yR/r/qGNhIQHDeK2.js could save 9.3KiB (63% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yr/r/V2fXuYrZ-4H.css could save 3.6KiB (71% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yY/r/Uj-Y3GNRxq1.js could save 3.3KiB (59% reduction).

我已经检查过我的服务器以确保 GZIP 已启用。我正在使用 Yoast SEO 插件在我的网站上启用 HTTP (gzip) 压缩。

这是我的 .htaccess 代码:

    <IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml

# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>

我不明白为什么压缩不起作用。请帮帮我。

网址:mysite

最佳答案

也添加这些行

<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_include mime ^text/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_include handler ^cgi-script$
</ifModule>

关于php - GZIP 压缩不适用于 Wordpress 网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34220884/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com