
內容簡介
許多 WordPress 的效能優化外掛都過於臃腫,並且包含您不需要的功能。這個外掛只專注在一個功能上,能夠增加網站效能,即添加「Vary: Accept-Encoding Header」來源,當瀏覽器發出請求時,會包含 HTTP Header 讓伺服器決定該回傳什麼內容。Vary Header 是描述說明該請求的相關資訊。快取應該只有在請求與快取中的相關 Vary 資訊相符時才使用。
這個外掛將在您的 WordPress 目錄的 .htaccess Apache 檔案中加入重寫規則。程式碼範例如下:
< IfModule mod_headers.c >
< FilesMatch \".(js|css|xml|gz|html)$\" >
Header append Vary: Accept-Encoding
< /FilesMatch >
< /IfModule >
外掛標籤
開發者團隊
② 後台搜尋「Specify a Vary: Accept-Encoding Header」→ 直接安裝(推薦)
原文外掛簡介
Many WordPress performance plugins are bloated and include features that you don’t need. This plugin does just one thing. It adds a “Vary: Accept-Encoding Header” to boost website performance.
When browsers make a request, they include HTTP headers for the server to decide what to send back. The Vary header describes what information identifies a request. Caches should only be used if the request matches the Vary information in the cache.
This plugin adds a rewrite rule to your WordPress directory’s .htaccess Apache file.
< IfModule mod_headers.c >
< FilesMatch \".(js|css|xml|gz|html)$\" >
Header append Vary: Accept-Encoding
< /FilesMatch >
< /IfModule >
