The transferSize read-only property represents the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body (as defined by RFC7230.

Note: This feature is available in Web Workers.

If the resource is fetched from a local cache, or if it is a cross-origin resource, this property returns zero.



Return value

A number representing the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body (RFC7230).


The following example, the value of size properties of all "resource" type events are logged.

function log_sizes(perfEntry){
  // Check for support of the PerformanceEntry.*size properties and print their values
  // if supported.
  if ("decodedBodySize" in perfEntry)
    console.log("decodedBodySize = " + perfEntry.decodedBodySize);
    console.log("decodedBodySize = NOT supported");

  if ("encodedBodySize" in perfEntry)
    console.log("encodedBodySize = " + perfEntry.encodedBodySize);
    console.log("encodedBodySize = NOT supported");

  if ("transferSize" in perfEntry)
    console.log("transferSize = " + perfEntry.transferSize);
    console.log("transferSize = NOT supported");
function check_PerformanceEntries() {
  // Use getEntriesByType() to just get the "resource" events
  var p = performance.getEntriesByType("resource");
  for (var i=0; i < p.length; i++) {


Specification Status Comment
Resource Timing Level 1
The definition of 'transferSize' in that specification.
Candidate Recommendation Initial definition.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 54Edge Full support 17Firefox No support NoIE No support NoOpera Full support 41Safari No support NoWebView Android Full support 54Chrome Android Full support 54Edge Mobile No support NoFirefox Android No support NoOpera Android Full support 41Safari iOS No support NoSamsung Internet Android Full support 6.0


Full support  
Full support
No support  
No support

Document Tags and Contributors

Contributors to this page: fscholz, chrisdavidmills, OliverJAsh2, jpmedley, rolfedh, AFBarstow
Last updated by: fscholz,