[WordPress] 外掛分享: SEV Rewrite-Free WebP for W3TC

首頁外掛目錄 › SEV Rewrite-Free WebP for W3TC
全新外掛
安裝啟用
尚無評分
6 天前
最後更新
問題解決
WordPress 6.0+ PHP 8.0+ v2.0.0 上架:2026-07-19

內容簡介

SEV Rewrite-Free WebP for W3TC 是一款輕量級的外掛,專為 W3 Total Cache 設計,能自動為支持 WebP 的瀏覽器提供 WebP 圖像。此外掛不需依賴伺服器重寫規則,適合在管理型主機環境中使用,簡化了圖像交付過程。

【主要功能】
• 無需 Apache 或 Nginx 重寫規則
• 自動檢測瀏覽器的 WebP 支持
• 僅在存在對應的 WebP 圖像時重寫 URL
• 支持 src、srcset、data-src 和 data-srcset 屬性
• 發送 Vary: Accept 標頭以正確緩存
• 輕量級且無需配置

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「SEV Rewrite-Free WebP for W3TC」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

SEV Rewrite-Free WebP for W3TC is a lightweight companion plugin for W3 Total Cache that automatically serves WebP images to browsers that support them.
Unlike traditional WebP delivery methods, this plugin does not rely on Apache or Nginx rewrite rules. No changes to .htaccess, mod_rewrite, or web server configuration are required. Instead, it rewrites image URLs directly in the generated HTML before the page is sent to the visitor.
This makes the plugin particularly useful on managed hosting environments, including many Plesk installations, where configuring or relying on web server rewrite rules is difficult, restricted, or simply not practical. If W3 Total Cache ImageService has already generated a WebP version of an image, this plugin serves it without requiring any server-side rewrite configuration.
This is an independent, unofficial add-on and is not affiliated with, endorsed by, or sponsored by BoldGrid / W3 EDGE, the makers of W3 Total Cache. “W3 Total Cache” is a trademark of its respective owner and is used here only to describe compatibility.
Features

No Apache or Nginx rewrite rules required.
No .htaccess modifications.
Automatically detects WebP support via the browser’s Accept header.
Rewrites image URLs only when a corresponding WebP image exists.
Supports src, srcset, data-src, and data-srcset attributes.
Sends a Vary: Accept header for correct browser, CDN, and proxy caching.
Extends the W3 Total Cache page cache key so WebP and non-WebP pages are cached separately.
Lightweight and requires no configuration.

How it works

A visitor requests a page.
The plugin checks the HTTP Accept header to determine whether the browser supports WebP.
It scans the post content for image URLs (src, srcset, data-src, and data-srcset).
For each image, it checks whether W3 Total Cache ImageService has already generated a WebP version.
If a WebP image exists, the corresponding URL in the generated HTML is replaced with the .webp URL.
A Vary: Accept response header is added so browsers, CDNs, and reverse proxies cache WebP and non-WebP responses separately.
The W3 Total Cache page cache key is extended with :webp or :no-webp, ensuring W3 Total Cache stores separate cached pages for browsers with and without WebP support.

Requirements

W3 Total Cache must be installed and active.
Images must have been converted using Media → W3TC Image Service.

Limitations
This plugin does not convert images to WebP. Image conversion is handled entirely by W3 Total Cache ImageService. If no WebP version exists for an image, the original image URL remains unchanged.

文章
Filter
Apply Filters
Mastodon