Location header fix; add YSlow version to beacon; valid protocols check #65

merged 3 commits into from Oct 8, 2013

2 participants


A couple patches that we've integrated into our YSlow code for GTmetrix:

Location header fix

Some sites have a Location header that points to itself. Firefox is smart enough to not follow the redirect, but YSlow doesn't handle it properly.

Add YSlow version to beacon

I don't think YSlow rules have changed much in a while, but I think it's important to save the YSlow version with the beacon data. It adds the version in as the 'v' parameter.

Valid protocols check

I'm not 100% on this one, but it's worked for us. YSlow gets stuck when there are resources on the page which use certain protocols (eg. file://, mms://). I've switched YSLOW.ComponentSet.isValidProtocol() to check against a small list of protocols that Firefox will work with (http, https, ftp). Not sure if other protocols should be added to the list or not.

brewt added some commits Jan 31, 2013
@brewt brewt Fix for some broken sites that have a Location header that points to …
…the same URL
@brewt brewt Add YSlow version to beacon cb91824
@brewt brewt Switch YSLOW.ComponentSet.ignoreProtocols to validProtocols. Some sit…
…es use protocols like file:// and mms:// and imho, it's easier to manage a list of valid protocols, then ignored ones.

Thanks @brewt for your valuable contribution. I don't see any problems with the first 2, however I have to test the 3rd change a little more against bookmarklet, HAR and PhantomJS. If everything works fine I'll merge your changes soon.

@marcelduran marcelduran merged commit aa4a688 into marcelduran:master Oct 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment