內容簡介
此外掛仍在實驗階段 - 使用需自負風險!
此外掛仍在開發中,請嘗試使用並聯繫我,如果您遇到任何錯誤或有任何問題或建議。如果您想幫助我進一步開發,請在GitHub上發送拉取請求。
該外掛尚未準備好投入生產,但我將很快發布0.1版,以便為生產做好準備。
WP-PJAX — PJAX for WordPress 外掛程式。
讓您的網站更快,並通過使用 PJAX 驅動的 WordPress 網站節省大量帶寬和 CPU 運算!
PJAX 是什麼?
PJAX 是一種技術,使用 AJAX 和 PushState,僅在每次頁面載入時加載和更新頁面 HTML 的部分。PushState 可以添加真實的永久鏈接,頁面標題和可用的 “返回” 按鈕,以便您的訪問者無法看出 PJAX 頁面載入和普通完整頁面載入之間的區別,當然速度快了些 🙂
為什麼要使用 PJAX?
它可以在大多數情況下使您的網站顯著加快,同時節省了處理能力和帶寬!
特點
加快任何網站的速度。啟用內置頁面緩存後,您可以期望頁面加載速度比以前快10-50%+。
支持 4 級應用程序緩存!此外掛使用瀏覽器緩存和頁面緩存。 (可選) 除去會話和 cookie,並啟用反向代理 (例如 Varnish) 緩存,並且與第三方緩存外掛 (例如 W3 Total Cache 推薦) 下的對象和數據庫緩存非常配合。
與W3 Total Cache 配合良好。
可配置。無需深入研究代碼。但是,您仍需要基本的 HTML 知識以及了解 WordPress 運行方式,以發揮此外掛的全部潛力。
每頁載入都會有一個帶有報告的實時通知 (載入時間,頁面緩存的命中或未命中,反向代理/ Varnish 緩存的命中或未命中等 — 請見屏幕截圖)。這對於調試和測試非常有用,當然只對管理員可見。
只需對您的主題進行幾個更改,即可輕鬆使用。不應該需要超過5分鐘的時間,並且僅需要基本知識。
瀏覽器支援
PJAX 不支援 Internet Explorer 9 及以下版本(IE 10+ 可支援),但該外掛程式通過在不支援的瀏覽器上回歸常規頁面載入來優雅地處理此問題。 有關瀏覽器支援的詳細信息
開發
此外掛的所有開發都在GitHub 上進行。請通過fork並發送拉取請求來幫助開發。
計劃中的功能 / 待辦事項
更好的選單活動類別處理。可能會使用正則表達式。支持標記父頁面活動將是很好的,但我不知道任何好的方法實現它。
更好地控制禁用 PJAX 的例外情況,當您使用頁面緩存時以及應該刪除哪些 cookie 和會話。將添加正則表達式支持。
在發布/更新時刷新緩存。
使用單獨的緩存加載側欄。
頁面載入通知/圖標。這也應該可定制,使用 css、文本(本地化)來,並且應該可以上傳自己的圖標。
頁面緩存預取需要重新檢討。WP-Cron有些
外掛標籤
開發者團隊
原文外掛簡介
THIS PLUGIN IS STILL EXPERIMENTAL – USE AT YOUR OWN RISK!
The plugin is under development. Please try it and contact me if you encounter any bugs or have any questions or suggestions. If you want to help me develop this further send a pull request on GitHub.
The plugin is not ready for production yet, but I will soon release version 0.1 that will be production ready.
WP-PJAX – PJAX for WordPress Plugin.
Makes your site faster and saves you a lot of bandwidth and CPU power by making your WordPress site PJAX powered!
What is PJAX?
PJAX is a technique that uses AJAX and PushState to deliver a faster browsing experience by only loading and updating parts of the page HTML each page load. PushState makes it possible to add real permalinks, page titles, and a working back button so that your visitors won’t be able to tell the difference between PJAX page load and ordinary full page loads, except for the increased speed of course :).
Why PJAX?
It makes your site significantly faster in most cases and saves you both processing power and bandwidth!
Features
Speeds up any website. With the built in page cache enabled you can expect 10-50+% faster page loads.
Supports 4 Levels of application cache! This plugin uses browser cache and page cache. It is also enabling reverse proxy(i.e. Varnish) cache by (optionally) striping sessions and cookies and it works very well with underlaying object and database cache using third party cache plugins such as W3 Total Cache (recommended).
Works well with W3 Total Cache.
Configurable. No need to dig into the code. You will still need basic knowledge about HTML and how WordPress works to make this plugin reach it’s full potential.
Live notices with a report for every page load (Load time, page cache hit or miss, Reverse proxy/Varnish cache miss or hit etc – See screenshot). This is great for debugging and testing and is of course only visible for admins.
Only a few changes in your theme and you are ready to go. Should not take more than 5 minutes and requires only basic knowledge.
Browser support
PJAX is not supported in Internet Explorer 9 and earlier(IE 10+ supports this), but the plugin handles this gracefully by falling back on regular page loads for unsupported browsers. Details on browser support
Development
All development of this plugin occurs on GitHub. Please help me develop this by forking and sending pull requests.
Planned features / To-Do
Better handling of menu active classes. Will probably use regex for this. Support for marking parent pages active would be nice but I don’t know any good ways to accomplish that.
Better control over exceptions for when to disable PJAX, when you use Page cache, and when and what cookies and sessions that should be striped. Regex support will be added.
Refresh cache on publish/update.
Separate loading of sidebars with separate cache.
Page loading notice / icon. This should also be customizable with css, text(localizable) and it should be possible to upload your own icon.
Page cache prefetch needs to be revisited. WP-Cron is a bit tricky and its hard to handle timeouts gracefully and reliably cross different environments.
Remove all debug code and general code cleanup. This will be finished before the 0.1 release.
Add an optional menu to the admin bar for clearing cache(all and current page).
Optimize execution flow for better performance
Maybe: Better way to generate the configurable javascript. I think of two options for this, ether use wp_localize_script to inject variables into javascript or to generate a javascript with PHP file when settings are saved.
Known issues
The PJAX toggle checkbox does not work. $.pjax.disable() does not seam to work as it should. Maybe I need to set a cookie with AJAX to set this for the current user and then handle it on the server side.
Development
All development of this plugin occurs on GitHub. Please help me develop this by forking and sending plull requests.
