I recently spun up a private instance of WPT using the ami-2a1cb142 EC2 image. In general I’ve been really happy with it.
Now I’m tracking an usual edge case. Here are the factors:
- Chrome, on Windows ( the EC2 instance mentioned above )
- Nginx w/ SPDY enabled, and gzip compression ( level 5 or 6 is what I’ve tested with )
- A file that is 1,602 bytes or smaller ( exact size might vary depending on how well it compresses ) that is the first resource requested in a SPDY connection
To simplify testing this I’ve reproduced the conditions on my private site with these two files:
These contain mostly random characters, the only difference between the two is a single character ( test-fast.html is 1,603 bytes, test-slow.html is 1,602 ).
The test-fast.html request is very quick, works the way I’d expect. The test-slow.html has a ~200ms delay in the time to first byte.
If these resources were just part of a page and the initial file requested in the SPDY connection was larger then this ~200ms delay never happens. It doesn’t happen for smaller files that are requested after the initial connection.
I’ve provided HAR files for test results from my private instance:
- https://josephscott.org/dev/spdy/josephscott.org.141023_ZP_D2-fast.har
- https://josephscott.org/dev/spdy/josephscott.org.141023_3A_D3-slow.har
The only difference in the two tests is the resource requested, and the only difference between those is one byte.
The delay doesn’t happen when testing with IE 10 - https://josephscott.org/dev/spdy/josephscott.org.141023_JS_DJ-IE10.har
So far I’ve only been able to recreate this delay using the WPT EC2 instance. But, I’ve got one other data point that confuses this as well. I found a small file on cloudflare.com to test against - https://www.cloudflare.com/static/javascripts/live/fp-c71f8d1e6cd0e89831d25176cca548d0/page/index.js?v=CB6-2013-08-01-1 - and it doesn’t have the ~200ms delay.
This leads me to believe that the wptdriver isn’t the only variable, but at the same time I’m only able to produce this delay on my EC2 instance.
In addition to sites at work and reproducing it on my personal site, there are others where this happens too:
- slow: https://thethemefoundry.com/wp-content/themes/ttf-reloaded/images/home/design.svg
- fast: https://thethemefoundry.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1
You can also see this when running tests from webpagetest.org:
- Chrome, slow: http://www.webpagetest.org/result/141023_K9_VX2/
- Chrome, fast: http://www.webpagetest.org/result/141023_D2_VXH/
- IE 10: http://www.webpagetest.org/result/141023_89_VXR/
It isn’t an exact comparison to my private instance, but you can still see the TTFB delay in there.
I haven’t been able to reproduce this on my Mac, an older Windows 7 desktop, the Windows 8 system of a co-worker. I can’t even reproduce this on separate non-WPT EC2 images:
- Windows_Server-2012-R2_RTM-English-64Bit-Base-2014.09.10 (ami-904be6f8)
- Windows_Server-2008-R2_SP1-English-64Bit-Base-2014.09.10 (ami-dc65c8b4)
Based on the data that I have so far it looks like this could be a bug on the Nginx side ( since CloudFlare doesn’t seem to have this issue ), but not being able to reproduce it on other Windows clients still leaves me with a small chance that this is WPT related ( or one of the components, like dummynet ).
Has anyone else seen this issue? If not, can others reproduce it with their WPT installs? And the big piece, can anyone reproduce this on a Windows system that has never had WPT installed?
Thank you.