Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2023年3月.
安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。
serverTiming は読み取り専用プロパティで、サーバーのタイミング測定が入った PerformanceServerTiming 項目の配列を返します。
サーバーのタイミング測定では、サーバーが次のような Server-Timing ヘッダーを送信する必要があります。
serverTiming の項目は、 navigation と resource の項目で使用することができます。
PerformanceServerTiming 項目の配列です。
PerformanceObserver を使用して、 PerformanceServerTiming 項目を監視することができます。各サーバー項目の時間は、コンソールにログ出力されます。
ブラウザーに記録された新しい resource パフォーマンス項目を通知する PerformanceObserver を使用した例です。オブザーバーが作成される前の項目にアクセスするには buffered オプションを使用します。
Performance.getEntriesByType() を使用した例です。このメソッドを呼び出した時点でブラウザー上のパフォーマンスタイムラインに存在する resource パフォーマンス項目のみを表示します。
サーバーのタイミング情報へのアクセスは、同じオリジン内に制限されます。オリジンをまたいでタイミング情報を公開するには、HTTP の Timing-Allow-Origin レスポンスヘッダーを設定する必要があります。
例えば、https://developer.mozilla.org にサーバーのタイミング情報を見ることを許可するには、cross-origin リソースを送信する必要があります。
| Server Timing # servertiming-attribute |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2023年8月25日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.