[WordPress] 外掛分享: Advanced WPPerformance

首頁外掛目錄 › Advanced WPPerformance
WordPress 外掛 Advanced WPPerformance 的封面圖片
10+
安裝啟用
★★★★★
5/5 分(2 則評價)
2602 天前
最後更新
問題解決
WordPress 4.7+ PHP 5.4+ v1.6.2 上架:2017-08-02

內容簡介

此外掛可為您的 WordPress 網站新增多個效能優化功能。與其他效能外掛不一樣的是,此外掛專注於 HTTP/2 標準(如伺服器推送和 SPDY)。

精簡資產

此外掛可將所有 CSS 及 JS 檔案進行精簡,並將它們進行快取。它不會將它們合併為一個文件。這樣您仍能使用有條件的資產,如果您使用 HTTP/2(我強烈建議),合併資產並不是必要的。

優化 JS 提供

此外掛會將所有腳本移至頁面底部,並加入 defer 屬性。這確保腳本不會阻止頁面呈現,但仍會按照正確的順序執行。
但某些情況下,這可能會破壞內嵌 JavaScript。

優化 CSS 提供

此外掛會從標頭中移除所有 CSS 檔案,並異步加載它們。這確保您的 CSS 檔案不會延遲頁面呈現。為了減少未有樣式內容閃爍(FOUT),我建議您加入關鍵 CSS。

有條件關鍵 CSS

預設情況下,此外掛會提供一個文字區域,供您放置關鍵 CSS。
詳見有條件的關鍵 CSS

關鍵 CSS API

我們新增了一個很棒的功能!
詳見關鍵 CSS API。

HTTP/2 伺服器推送

伺服器推送是一項 HTTP/2 功能,允許您在使用者要求資源之前向其發送網站資產。有兩種實現方式,都各有優缺點。因此,此外掛支援兩種方式,取決於您。

PHP

當 WordPress 建立您的網站時,此外掛會獲取所有已列入佇列的腳本和樣式表,並將它們作為鏈結屬性添加到響應標題中。因此,您可以確定只有實際需要文件才會被推送。

但是:由於它們是在建立網站時設置的,如果您使用伺服器快取(我強烈建議這麼做),這樣就行不通了。

.htaccess

第二個選項是將所有推送的檔案放入您的 .htaccess 中。這樣,即使您使用伺服器快取,這些檔案仍會被推送。

但是:如果您的資產變更(新版本/已停用的腳本),請勿忘記更新 .htaccess。只需在儲存設定時點擊一下即可。

貢獻

此外掛的開發版本存放在 GitHub 上。如果您有改進的想法,請自由發揮,深入探究程式碼:
https://github.com/nico-martin/Advanced-WPPerformance

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.6.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Advanced WPPerformance」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin adds several performance improvements to your WordPress site. In contrst to other performance Plugins, this one sets focus on HTTP\2 Standards (like Server Push and SPDY).
minify assets
This plugin minifies all CSS and JS Files and caches them. It will not merge them into on file. This way you are still able to use conditional assets and if you are using HTTP/2, which I highly recommend, it’s not necessary to do so.
Optimizes JS Delivery
It moves all scripts to the footer and adds a defer attribute. This makes sure the scripts won’t block the page render process but will still be executed in the right order.
In some cases, this could break inline JavaScript
Optimizes CSS Delivery
All CSS Files will be removed from the head and loaded asynchronously. This makes sure your CSS Files won’t delay the page rendering. To reduce the flash of unstyled content (FOUT) I recommend adding a Critical CSS.
conditonal Critical CSS
By default this plugin provides a textarea where you can put your critical CSS.
Read more about Conditional critical CSS
Critical CSS API
We implemented an awesome new feature!
Read more about the Critical CSS API.
HTTP/2 Server Push
Server push is a HTTP/2 feature that allows you to send site assets to the user before they’ve even asked for them.
There are two ways to achieve this. Both have their pros and cons. So this plugin supports both, the decision is up to you.
PHP
While WordPress builds your site, this plugin gets all enqueued scripts and styles and adds them as a link attribute to the response headers. That way you can be certain only files are being pushed, that are actually needed.
But: Since they are set while the server builds your site, this won’t work if you’re using a server caching (which I highly recommend).
.htaccess
The second option puts all files to push inside you .htaccess. This way they are being pushed also if you’re using server caching.
But: If your assets change (new versions / depreciated scripts), don’t forget to update the .htaccess. This can be done with one click while saving the settings.
Contribute
A development version of this plugin is hosted on github. If you have some ideas for improvements, feel free to dive into the code:
https://github.com/nico-martin/Advanced-WPPerformance

文章
Filter
Mastodon