這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

SJ HTTP/2 Server Push Optimization

外掛說明

HTTP/2 is the new generation HTTP protocol that provide tremendous powers the web. HTTP/2 is future of web. The most powerful feature of HTTP/2 is server push. Most of popular hosting providers supports to Server Push. Server Push provides significant performance gains if used judiciously.

Check HTTP/2 Demo Here.

Server Push allows the server to “bundle” assets that the client didn’t ask for.It send resources to the browser before it even realizes it needs them. This avoids the usual HTTP request/response cycle.

This plugin enabled WordPress to send a Link:<...> rel="prefetch" header to every enqueued script and style page. Is doesn’t support who output their scripts directly into the page itself. This plugin doesn’t affect any visual part of site.

Read more about server push here

Note : It requires a web server that supports HTTP/2.

WordPress 4.6 and above

WordPress 4.6 introduced support for resource hints.
This plugin defers to WordPress 4.6 and theme/plugin developers to responsibly prefetch the right assets.

I’ve added a filter To restore the old behavior of resource hints on WordPress 4.6 and above. Use following filter in your functions.php file or in a custom plugin:

`add_filter('sjh_http2_resource_hints', '__return_true');```

安裝方式

  1. Upload the plugin files to the /wp-content/plugins/sj-http2-server-push directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress

常見問題集

What if my web server doesn’t support HTTP/2 or “server push”?

Server push is triggered by the same mechanism as link prefetching, which almost all major modern browsers support over HTTP 1.x. You can take advantage of “preload” even if you don’t have HTTP/2’s features. People visiting your site may still get a better experience from it. Read here about preload

How do I know if this is working?

There are a couple ways:

  1. nghttp is an HTTP/2 client that ships with the nghttp2 suite. nghttp -v http://example.com will show all the HTTP/2 signalling packets, HTTP headers, content, and resources sent from the server in a single request. You can see PUSH PROMISE signals from the server and the pushed resources after the main page is sent.
  2. In Google Chrome, chrome://net-internals/#spdy will show a history of server connections from the browser. Clicking on a connection will show the discussion between the browser and the server. Within that text, you can see PUSH PROMISE packets and the pushed resources.

使用者評論

There are no reviews for this plugin.

參與者及開發者

以下人員參與了開源軟體〈SJ HTTP/2 Server Push Optimization〉的開發相關工作。

參與者

將 SJ HTTP/2 Server Push Optimization 外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.0

  • Initial release