內容簡介
commonWP 是一個外掛,可啟用自由、公共的 CDN (jsDelivr) 來使用開源 JavaScript 和 CSS 文件。這些文件包括:
WordPress 核心中的所有文件,除非使用 WordPress 的開發版本。
由 WordPress.org 插件庫托管的所有插件文件,除非特定插件的作者不使用 SVN 標籤進行發布。
由 WordPress.org 主題庫托管的所有主題文件。
由 GitHub 上托管的插件和主題文件,支持 GitHub Updater。
在任何類型的主題、插件或 MU 插件中標記為在npm上可用的所有文件。
它旨在既輕量又非常安全。這個插件所使用的方法比啟用任何 CDN 的任何其他插件都更安全。首先,commonWP 只會在遠程文件與本地文件完全相同的情況下將文件重寫,指向 jsDelivr 上的文件。其次,在比較過程中,它會生成遠程 jsDelivr 文件的 子資源完整性 Hash,並將該 Hash 包含在頁面的源代碼中,因此如果瀏覽器沒有完全相同的 Hash,它不會加載遠程文件。
它沒有任何設置。啟用後,它將在後台填充缓存,這可能需要一些時間,具體取決於站點使用的資源數量。
有關 commonWP 的更多詳細信息,請前往其GitHub 存儲庫。
外掛標籤
開發者團隊
原文外掛簡介
commonWP is a plugin that enables usage of free, public CDN (jsDelivr) for open source JavaScript and CSS files. Those files are:
All files from WordPress core, unless development version of WordPress is used.
All files from plugins hosted by WordPress.org Plugins Repository, unless author of specific plugin doesn’t use SVN tags for releasing.
All files from themes hosted by WordPress.org Themes Repository.
All files from plugins and themes hosted on GitHub that support GitHub Updater.
All files marked as available on npm in any type of theme, plugin, or MU plugin.
It aims to be both lightweight and very secure. The approach used in this plugin is safer then in any other plugin that enables usage of any CDN. First, commonWP will only rewrite file to point to one on jsDelivr if that remote file is identical to local one. Second, during comparison, it generates subresource identity hash of remote jsDelivr file and includes that hash in page’s source code so browser won’t load remote file if it doesn’t have exactly the same hash.
There are no any settings. After activation, it will fill up its cache in the background, and that may take some time depending on number of resources site uses.
For much more details about commonWP, head over to its GitHub repository.
