Comments for High Performance Web Sites Essential knowledge for making your web pages faster. Wed, 17 Sep 2014 15:45:09 +0000 hourly 1 Comment on Onload in Onload by Steve Souders Wed, 17 Sep 2014 15:45:09 +0000 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) Wed, 17 Sep 2014 13:48:48 +0000 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 Sat, 30 Aug 2014 17:10:10 +0000 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.

Comment on Resource Timing practical tips by Steve Souders Fri, 29 Aug 2014 16:50:21 +0000 Brian: Some beaconing packages track the querystring length and break it across multiple beacons when necessary. Doing a POST is also possible. I agree – sending back Resource Timing data for every resource in the page is likely to exceed URL length. FYI – Eric Lawrence just blogged about this in URL Length Limits.

Comment on HTTP Archive – new stuff! by Steve Souders Fri, 29 Aug 2014 16:42:35 +0000 Saurabh: All the code exists to do what you want, but I admit that it has minimal documentation. Let me answer your questions and perhaps that will generate a first draft of code for setting up a private instance of HTTP Archive.

The code for doing the crawl is in the bulktest subdirectory. I use crontab to schedule when the crawl happens. Look at crontab.txt. I schedule crawls for the 1st and 15th of each month. I execute batch_log.php every 30 minutes to move the crawl along.

Wrt the set of URLs, that’s controlled by the commandline options to batch_start.php. I specify no options which means it uses the Alexa Top 1M list of URLs. Instead, you could pass in a file as the first parameter:
batch_start.php urls.txt
where urls.txt contains one URL per line.

The key place for customization is where you configure MySQL and the URL to your private instance of WebPagetest. Further WebPagetest config options are specified in You might need to create bulktest/ – that’s not in Github as it’s optional depending on your WebPagetest configuration.

Comment on HTTP Archive – new stuff! by Saurabh Thu, 28 Aug 2014 19:30:48 +0000 Hey.. Thanks for this amazing tool, I want to run a my own copy of the HttpArchive crawler with my own mysql instance, I was able to set it up locally. I need to crawl over my own set of URLs, is there a way to configure URLs that it crawls and customize when crawling happens?
I am new to php so tried but could not find such code in the repository. Thanks in advance.

Comment on Resource Timing practical tips by Brian Nørremark Thu, 28 Aug 2014 17:02:15 +0000 Great that Boomerang got a Ressource Timing plugin. Boomerang does HTTP/GET only, so how do we did around the 2K character limit in browsers? POSTing it feels wrong.

I haven’t cross referenced support for Ressource Timing with max URL length, it could be that this is simply not a problem?

Comment on Resource Timing practical tips by Andy Davies Tue, 26 Aug 2014 11:14:06 +0000 As far as I know the other types that could be used in getEntriesByType are ‘mark’, ‘measure’, and ‘navigation’

‘mark’ and ‘measure’ are from User Timing ( and ‘navigation’ is from the Navigation Timing 2 spec ( – though I don’t know of any browsers that implement the draft spec yet.

If you want to see ‘mark’ and ‘measure’ in action you can fire up Dev Tools on one of WebPagetest’s waterfall pages and type window.performance.getEntriesByType(‘mark’); in the console.

window.performance.measure(“elapsed”, “aft.Site Header”, “aft.Waterfall”); can be used to generate a measure and then window.performance.getEntriesByType(‘measure’); to retrieve the list of measures.

I agree with the recommendation to use performance.getEntriesByType(“resource”) to get the resource timing entries as it makes the code more resilient in the future, other option would be to check the array elements to ensure they have an entryType of ‘resource’ but that needs to be done everywhere!

Comment on Resource Timing practical tips by Steve Souders Thu, 21 Aug 2014 18:24:43 +0000 @Bram: It’s great that Typekit includes this header! I added an update mentioning additional 3rd parties who specify Timing-Allow-Origin.

Comment on Resource Timing practical tips by Cliff Thu, 21 Aug 2014 18:05:38 +0000 Great post! This is a terrific start to a much needed discussion around resource timing. I hope we can all chat about this at WebPerfDays NY!