Comments for High Performance Web Sites http://www.stevesouders.com/blog Essential knowledge for making your web pages faster. Wed, 29 Oct 2014 12:31:39 +0000 hourly 1 http://wordpress.org/?v=3.7.4 Comment on Resource Timing practical tips by Michael Mrowetz http://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/#comment-61063 Wed, 29 Oct 2014 12:31:39 +0000 http://www.stevesouders.com/blog/?p=4099#comment-61063 Inspired by this article I’ve setup a bookmarklet to read visuallize the Resource and Navigation API as well as User Timing: https://github.com/nurun/performance-bookmarklet

]]>
Comment on Onload in Onload by Saikat http://www.stevesouders.com/blog/2014/09/12/onload-in-onload/#comment-61059 Tue, 21 Oct 2014 11:41:32 +0000 http://www.stevesouders.com/blog/?p=4157#comment-61059 I don’t know how good it is but can’t we fire another onload event i.e so that the second window onload function gets fired by the fake load event. like this

window.onload=function()
{
alert(“onload1″);
window.onload=function(){
alert(“onload2″);
}

var evt = document.createEvent(‘Event’);
evt.initEvent(‘load’, false, false);
window.dispatchEvent(evt);
}
//so both alerts are shown

]]>
Comment on do u webview? by Daniel http://www.stevesouders.com/blog/2014/10/09/do-u-webview/#comment-61058 Fri, 17 Oct 2014 07:36:57 +0000 http://www.stevesouders.com/blog/?p=4179#comment-61058 A lot of this is pretty relevant to a project we’re on the edge of completing now.

We’ve discovered and overcome a lot of nuances and quirks with webviews on both iOS and Android so this is a great reference to start writing up some of the lessons we learned.

I’m especially excited about the V8 going in there for the new webviews!

Thanks for this post!

]]>
Comment on Onload in Onload by Laurens van Hees http://www.stevesouders.com/blog/2014/09/12/onload-in-onload/#comment-61057 Mon, 13 Oct 2014 06:34:57 +0000 http://www.stevesouders.com/blog/?p=4157#comment-61057 Another tip, when the Navigation Timing API is available you can do something like this as well:

var isLoadFired = window.performance.timing.loadEventStart > 0;

]]>
Comment on Resource Timing practical tips by Radko Dinev http://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/#comment-61054 Fri, 03 Oct 2014 10:13:20 +0000 http://www.stevesouders.com/blog/?p=4099#comment-61054 Firefox supports the Resource Timing API since version 31 behind the `dom.enable_resource_timing` preference flag which is `false` by default.

]]>
Comment on Onload in Onload by Steve Souders http://www.stevesouders.com/blog/2014/09/12/onload-in-onload/#comment-61053 Fri, 26 Sep 2014 19:34:09 +0000 http://www.stevesouders.com/blog/?p=4157#comment-61053 It’s more overhead to have a timer looping like that.

]]>
Comment on Onload in Onload by Allen Lee http://www.stevesouders.com/blog/2014/09/12/onload-in-onload/#comment-61052 Fri, 26 Sep 2014 19:01:01 +0000 http://www.stevesouders.com/blog/?p=4157#comment-61052 Great post.

So why not use document.readyState directly and skip onload and addEventListener entirely? IE

var f = function() { …. };

function fAfterLoad() {
if (document.readyState == “complete”) f();
else window.setTimeout(fAfterLoad, 250)
};

fAfterLoad()

The use case is a third party snippet for analytics that should be transparent to the user, i.e. google analytics. This has the advantage of being compatible with all browsers without special hacks for IE8 and not over writing window.onload, which could be used by the page.

]]>
Comment on Onload in Onload by Steve Souders http://www.stevesouders.com/blog/2014/09/12/onload-in-onload/#comment-61051 Wed, 17 Sep 2014 15:45:09 +0000 http://www.stevesouders.com/blog/?p=4157#comment-61051 Philip: I tested Boomerang while writing this post and was pleased to see it used readyState to avoid this problem. You’re always one step ahead.

]]>
Comment on Onload in Onload by Philip Tellis (@bluesmoon) http://www.stevesouders.com/blog/2014/09/12/onload-in-onload/#comment-61050 Wed, 17 Sep 2014 13:48:48 +0000 http://www.stevesouders.com/blog/?p=4157#comment-61050 Hi Steve,

The addEventListener spec states that if an event handler is added via code that runs as part of that event, then the new handler will only be called on subsequent invocations of the event. Since onload can only fire once, this means that onload handlers added in onload will never be called (assuming browsers follow the spec for this).

I noticed this when we started loading boomerang using the iframe loader technique, since there was now a possibility that it could load after onload (and well, some of our customers load boomerang in the onload event). As a result, boomerang has been using document.readyState for a while now to check if onload has already fired when it loads up.

]]>
Comment on Resource Timing practical tips by Brian Nørremark http://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/#comment-61048 Sat, 30 Aug 2014 17:10:10 +0000 http://www.stevesouders.com/blog/?p=4099#comment-61048 Steve: Any beaconing packages you can recommend? I don’t think Boomerang splits up into multiple beacons.

An idea for a more robust data could be to capture aggregated data, like the ones that HTTPArchive tracks. response sizes is not possible, but you could easily aggregate: # JS/CSS/GIF/PNG/JPG/HTML/Fonts/Flash/Other requests, # HTTPS requests, # iframes, and probaly a few more.
The more I think about it, the more I like the idea. Correlations makes it all worth it, even though SPDY may change the picture quite a lot.

]]>