[WordPress] 外掛分享: Speculative Loading

首頁外掛目錄 › Speculative Loading
WordPress 外掛 Speculative Loading 的封面圖片
70,000+
安裝啟用
★★★★★
5/5 分(18 則評價)
105 天前
最後更新
100%
問題解決
WordPress 6.6+ PHP 7.2+ v1.6.0 上架:2024-01-18

內容簡介

- 這個 WordPress 外掛支援 Speculation Rules API,該 API 可以根據使用者互動,定義規則來動態預取或預渲染特定的 URL。
- 請參閱 Speculation Rules WICG 規範草案。
- 預設情況下,當使用者將滑鼠懸停在相關連結上時,外掛會預渲染 WordPress 前端網址。可以透過在「設定」>「閱讀」下的「Speculation Rules」部分自訂此功能。
- 可以使用篩選器來排除某些 URL 路徑不符合預取和預渲染的條件(請參閱常見問題解答)。或者,您可以將「no-prerender」CSS 類別添加到不應該預渲染的任何連結(<a> 標籤)上。
- 瀏覽器支援:Speculation Rules API 是一個新的 Web API,外掛目前使用的具體語法需要使用 Chrome 121+。
- 其他瀏覽器不會遇到任何負面影響,但對於那些瀏覽器來說,此功能將無法運作。

一般 Speculation Rules API 的瀏覽器支援
外掛使用的文件規則語法支援相關資訊

外掛標籤

開發者團隊

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

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

原文外掛簡介

This plugin adds support for the Speculation Rules API, which allows defining rules by which certain URLs are dynamically prefetched or prerendered. This core Speculative Loading functionality was merged into WordPress 6.8, but it only prefetches with conservative eagerness by default. In contrast, this plugin defaults to prerendering with moderate eagerness (i.e. when interacting with a link), and it provides a user interface to customize the mode and eagerness via the “Speculative Loading” section on the Settings > Reading admin screen.
By default, speculative loading is only enabled for logged-out users, since unauthenticated pages are typically only eligible for caching and so more efficient to prefetch/prerender. This means that sites with frequent logged-in users on the frontend—such as e-commerce, forums, or membership sites—will not benefit from the feature. If your server can handle the additional load (for example, with persistent object caching), you can opt in to enable speculative loading for all logged-in users or for administrators only. This setting exclusively affects frontend pages; admin screens are always excluded.
A filter can be used to exclude certain URL paths from being eligible for prefetching and prerendering (see FAQ section). Alternatively, you can add the no-prerender CSS class to any link ( tag) that should not be prerendered. See FAQ for more information.
Browser support
The Speculation Rules API is a new web API, and the functionality used by the plugin is supported in Chromium-based browsers such as Chrome, Edge, or Opera using version 121 or above. Other browsers such as Safari and Firefox will ignore the functionality with no ill effects; they will simply not benefit from the speculative loading. Note that certain browser extensions may disable preloading by default.

Browser support for the Speculation Rules API in general
Information on document rules syntax support used by the plugin

This plugin was formerly known as Speculation Rules.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon