Server Timing API All In One


Server Timing API All In One

// Catch errors since some browsers throw when using the new `type` option.
// https://bugs.webkit.org/show_bug.cgi?id=209216
try {
  // Create the performance observer.
  const po = new PerformanceObserver((list) => {
    for (const entry of list.getEntries()) {
      // Logs all server timing data for this response
      console.log('Server Timing', entry.serverTiming);
    }
  });
  // Start listening for `navigation` entries to be dispatched.
  po.observe({type: 'navigation', buffered: true});
} catch (e) {
  // Do nothing if the browser doesn't support this API.
}

https://developer.chrome.com/docs/devtools/network/reference/#timing-explanation

Stalled. The request could be stalled for any of the reasons described in Queueing.

停滯了。請求可能因排隊中描述的任何原因而停止。

Server Timing API

API 性能測試, 頁面秒開

The Server Timing API allows you to pass request-specific timing data from your server to the browser via response headers.

服務器計時 API 允許您通過響應標頭將特定於請求的計時數據從您的服務器傳遞到瀏覽器。

https://web.dev/custom-metrics/?utm_source=devtools#server-timing-api

https://web.dev/custom-metrics/?utm_source=devtools#:~:text=}-,server timing api

refs



©xgqfrms 2012-2020

www.cnblogs.com/xgqfrms 發布文章使用:只允許注冊用戶才可以訪問!

原創文章,版權所有©️xgqfrms, 禁止轉載 🈲️,侵權必究⚠️!



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM