Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to obtain the network size of all loaded resources in a web page?

In order to analyse page load performance I need to know the total network size of all the resources on a page (html, static content). Is there a way to do this on the client side with javascript?

Clarification: The data needs to be sent to a server for analysis, so I need access to network size in javascript.

like image 758
trimstring Avatar asked Nov 11 '22 11:11

trimstring


1 Answers

There is ongoing effort called Navigation Timing to profide such a thing:

http://www.html5rocks.com/en/tutorials/webperformance/basics/

The article explains how modern browsers are implementing an API to better access performance information. The most interesting part is about the processing model, you can also read about it on the w3 site:

http://www.w3.org/TR/navigation-timing/#processing-model

According to the article the simplest way to try out the API is to take a look at window.performance in your browser's JavaScript console.

like image 69
Christophe Roussy Avatar answered Nov 15 '22 11:11

Christophe Roussy