使用 fetchpriority=high 最佳化最大內容繪製 (Largest Contentful Paint,LCP) 圖片載入,並使用真實使用者指標透過用戶端偵測為圖片套用延遲載入。
評分
最近更新:
June 7, 2024
版本
0.1.1
活躍安裝總數
3K
Image Prioritizer

This plugin optimizes the loading of images which are the LCP (Largest Contentful Paint) element, including both img elements and elements with CSS background images (where there is a style attribute with an background-image property). Different breakpoints in a theme’s responsive design may result in differing elements being the LCP element. Therefore, the LCP element for each breakpoint is captured so that high-fetchpriority preload links with media queries are added which prioritize loading the LCP image specific to the viewport of the visitor.

In addition to prioritizing the loading of the LCP image, this plugin also optimizes image loading by ensuring that loading=lazy is omitted from any image that appears in the initial viewport for any of the breakpoints, which by default include:

  1. 0-320 (small smartphone)
  2. 321-480 (normal smartphone)
  3. 481-576 (phablets)
  4. >576 (desktop)

If an image does not appear in the initial viewport for any of these viewport groups, then loading=lazy is added to the img element.

👉 Note: This plugin optimizes pages for actual visitors, and it depends on visitors to optimize pages (since URL metrics need to be collected). As such, you won’t see optimizations applied immediately after activating the plugin. And since administrator users are not normal visitors typically, optimizations are not applied for admins by default.

There are currently no settings and no user interface for this plugin since it is designed to work without any configuration.

This plugin requires the Optimization Detective plugin as a dependency. Please refer to that plugin for additional background on how this plugin works as well as additional developer options.

免費使用Creator方案
活躍安裝總數
3K
目前已測試版本
6.5.5
此外掛程式已可供下載,並可用於你的 WordPress 自助託管安裝。