MDN self-hosted library · e01.org

PerformanceResourceTiming: contentEncoding property

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const observer = new PerformanceObserver((list) => {
  const dictionaryCompressedResources = list
    .getEntries()
    .filter(
      (entry) =>
        entry.contentEncoding === "dcb" || entry.contentEncoding === "dcz",
    );
  console.log(dictionaryCompressedResources);
});

observer.observe({ type: "resource", buffered: true });
js
const dictionaryCompressedResources = performance
  .getEntriesByType("resource")
  .filter(
    (entry) =>
      entry.contentEncoding === "dcb" || entry.contentEncoding === "dcz",
  );
console.log(dictionaryCompressedResources);