I’m starting to play around with Boomerang for measuring performance. It’s very promising. While it allows me to measure latency, bandwidth and page load times, I’m also interested in trying to get the time it took to render the initial HTML page server-side. Wile it seems straightforward to log the time at which the browser started parsing the javascript (which is close to when it initally arrived) in order to get an estimate of the server time, I need to work out how much network time to deduct. So to do that, I need to know how large the html document is.
How can I tell this from Javascript?
The document object does not appear to have an innerHtml property
I tried
totsize=document.HEAD.innerHTML.length + document.BODY.innerHTML.length;
The HEAD and BODY entities appear in the DOM browser within Firefox – but when I try the code above I get an undefined error – also tried with ‘head’ – to no avail.
Any ideas?
(note that javascript is in a seperate file and will be cached in most cases – so that’s not a big problem).
I did try google – but I just get lots of pages describing the on-screen size of html elements and the window dimensions 🙁
TIA
How about
document.documentElement.innerHTML.length?