[WordPress] 外掛分享: Speed Up – Optimize CSS Delivery

首頁外掛目錄 › Speed Up – Optimize CSS Delivery
WordPress 外掛 Speed Up – Optimize CSS Delivery 的封面圖片
600+
安裝啟用
★★★★★
5/5 分(8 則評價)
7 天前
最後更新
問題解決
WordPress 6.0+ PHP 7.0+ v1.0.14 上架:2016-12-07

內容簡介

此外掛旨在優化 CSS 的傳遞方式,以改善頁面載入速度。雖然不再推薦使用,但仍可透過異步載入樣式表來提升性能,並減少累積佈局偏移(Cumulative Layout Shift)。

【主要功能】
• 異步載入樣式表以提升頁面速度
• 支援選擇性同步載入重要樣式表
• 可自訂排除特定樣式表的過濾器

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Speed Up – Optimize CSS Delivery」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin is no longer recommended. Deferring every stylesheet makes the page paint before its own layout arrives. That flash of unstyled content is measured as Cumulative Layout Shift — one of the Core Web Vitals this plugin is meant to improve.
The current advice is to inline the CSS needed for the top of the page and defer only the rest, which is more than rewriting a link tag can do.
If you have not configured the exclusion filter for your main stylesheets, deactivating this plugin will most likely improve your scores rather than worsen them.
This small plugin (5 Kb) loads the stylesheets asynchronously and improve page load times.
The recommended use of this plugin is to load your vital stylesheets synchronously and non-vital CSS files asynchronously.
Non-vital CSS-files can be for example: fonts, icons, before the fold template-specific CSS, etc.
You can choose which files to load synchronously with a filter in your function.php, eg.:
// exclude main and child stylesheets from delivery optimization
function exclude_from_delivery_optimization($handle){
return in_array($handle, array('main-stylesheet', 'child-stylesheet'));
}
add_filter('speed-up-optimize-css-delivery', 'exclude_from_delivery_optimization');

Note: this only works if your other plugins and theme add the CSS correctly.

文章
Filter
Apply Filters
Mastodon