sitespeedio / coach

Clear Eyes. Full Hearts. Can’t Lose.
MIT License
1.21k stars 64 forks source link

Miss-reporting HTTP/2 #163

Closed bronzehedwick closed 7 years ago

bronzehedwick commented 8 years ago

I ran webcoach on the mayo clinic website and got a strange result; webcoach reported HTTPS was not enabled (true), but that HTTP/2 was (false, and also impossible).

After a bit of investigation, I noticed that Mayo was loading some adsense scripts from Google that were server over HTTP/2, but obviously none of their resources were.

I think webcoach should only report HTTP/2 if the target domain serves resources as HTTP/2.

beenanner commented 8 years ago

@bronzehedwick are you using the command line npm module or the chrome extension? Can you post the command executed with the output you are seeing?

bronzehedwick commented 8 years ago

Hi @beenanner, I am using the command line module, with webcoach --format json --output mayo.json http://www.mayoclinic.org/.

Here's the output:

{
  "advice": {
    "accessibility": {
      "adviceList": {
        "altImages": {
          "advice": "The page has 12 images that lack alt attribute(s) and 8 of them are unique.",
          "description": "All img tags require an alt attribute. This goes without exception. Everything else is an error. If you have an img tag in your HTML without an alt attribute, add it now. https://www.marcozehe.de/2015/12/14/the-web-accessibility-basics/",
          "id": "altImages",
          "offending": [
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-patientcare.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-docsdepts.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-research.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-meded.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-medprofs.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2014/04/29/12/35/globalnav-you-are-blue.jpg",
            "http://www.mayoclinic.org/~/media/KCMS/GBS/Patient%20Consumer/Images/2016/07/25/13/58/mc-banner_web1_960x400.jpg",
            "http://www.mayoclinic.org/~/media/KCMS/GBS/Patient%20Consumer/Images/2016/07/25/13/58/mc-banner_web2_960x400.jpg",
            "http://www.mayoclinic.org/~/media/KCMS/GBS/Patient%20Consumer/Images/2016/07/25/13/58/mc-banner_web1_960x400.jpg",
            "http://www.mayoclinic.org/~/media/KCMS/GBS/Patient%20Consumer/Images/2016/07/25/13/58/mc-banner_web2_960x400.jpg",
            "http://www.mayoclinic.org/~/media/KCMS/GBS/Patient%20Consumer/Images/2016/07/25/13/58/mc-banner_web1_960x400.jpg",
            "http://www.mayoclinic.org/~/media/KCMS/GBS/Patient%20Consumer/Images/2016/07/25/13/58/mc-banner_web2_960x400.jpg"
          ],
          "score": 0,
          "tags": [
            "accessibility",
            "images"
          ],
          "title": "Always use an alt attribute on image tags",
          "weight": 5
        },
        "headings": {
          "advice": "The page is missing a h1 and has heading(s) with lower priority.",
          "description": "Headings give your document a logical, easy to follow structure. Have you ever wondered how Wikipedia puts together its table of contents for each article? They use the logical heading structure for that, too! The H1 through H6 elements are unambiguous in telling screen readers, search engines and other technologies what the structure of your document is. https://www.marcozehe.de/2015/12/14/the-web-accessibility-basics/",
          "id": "headings",
          "offending": [
          ],
          "score": 90,
          "tags": [
            "accessibility",
            "html"
          ],
          "title": "Use heading tags to structure your page",
          "weight": 4
        },
        "labelOnInput": {
          "advice": "There are 2 input(s) that are missing labels on a form.",
          "description": "Most input elements, as well as the select and textarea elements, need an associated label element that states their purpose. The only exception is those that produce a button, like the reset and submit buttons do. Others, be it text, checkbox, password, radio (button), search etc. require a label element to be present. https://www.marcozehe.de/2015/12/14/the-web-accessibility-basics/",
          "id": "labelOnInput",
          "offending": [
          ],
          "score": 80,
          "tags": [
            "accessibility",
            "form"
          ],
          "title": "Always set labels on inputs in forms",
          "weight": 3
        },
        "landmarks": {
          "advice": "",
          "description": "Landmarks can be article, aside, footer, header, nav or main tag. Adding such landmarks appropriately can help further provide sense to your document and help users more easily navigate it. https://www.marcozehe.de/2015/12/14/the-web-accessibility-basics/",
          "id": "landmarks",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "accessibility",
            "html"
          ],
          "title": "Structure your content by using landmarks",
          "weight": 5
        },
        "neverSuppressZoom": {
          "advice": "",
          "description": "A key feature of mobile browsing is being able to zoom in to read content and out to locate content within a page. http://www.iheni.com/mobile-accessibility-tip-dont-suppress-pinch-zoom/",
          "id": "neverSuppressZoom",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "accessibility"
          ],
          "title": "Don't suppress pinch zoom",
          "weight": 8
        },
        "sections": {
          "advice": "The page doesn't use sections. You could use them to get a better structure of your content.",
          "description": "Section tags should have at least one heading element as a direct descendant.",
          "id": "sections",
          "offending": [
          ],
          "score": 0,
          "tags": [
            "accessibility",
            "html"
          ],
          "title": "Use headings tags within section tags to better structure your page",
          "weight": 0
        },
        "table": {
          "advice": "",
          "description": "Add a caption element to give the table a proper heading or summary. Use th elements to denote column and row headings. Make use of their scope and other attributes to clearly associate what belongs to which. https://www.marcozehe.de/2015/12/14/the-web-accessibility-basics/",
          "id": "table",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "accessibility",
            "html"
          ],
          "title": "Use caption and th in tables",
          "weight": 5
        }
      },
      "score": 80
    },
    "bestpractice": {
      "adviceList": {
        "charset": {
          "advice": "",
          "description": "The Unicode Standard (UTF-8) covers (almost) all the characters, punctuations, and symbols in the world. Please use that.",
          "id": "charset",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "bestpractice"
          ],
          "title": "Declare a charset in your document",
          "weight": 2
        },
        "doctype": {
          "advice": "",
          "description": "The <!DOCTYPE> declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in.",
          "id": "doctype",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "bestpractice"
          ],
          "title": "Declare a doctype in your document",
          "weight": 2
        },
        "https": {
          "advice": "What!! The page is not using HTTPS. Every unencrypted HTTP request reveals information about user’s behavior, read more about it at https://https.cio.gov/everything/. You can get a totally free SSL/TLS certificate from https://letsencrypt.org/.",
          "description": "A page should always use HTTPS ( https://https.cio.gov/everything/). You also need that for HTTP/2! You can get your free SSL/TLC certificate from https://letsencrypt.org/.",
          "id": "https",
          "offending": [
          ],
          "score": 0,
          "tags": [
            "bestpractice"
          ],
          "title": "Serve your content securely",
          "weight": 10
        },
        "httpsH2": {
          "advice": "",
          "description": "Using HTTP/2 together with HTTPS is the new best practice. If you use HTTPS (you should), you should also use HTTP/2.",
          "id": "httpsH2",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "bestpractice"
          ],
          "title": "Serve your content using HTTP/2",
          "weight": 2
        },
        "language": {
          "advice": "",
          "description": "According to the W3C recommendation you should declare the primary language for each Web page with the lang attribute inside the <html> tag https://www.w3.org/International/questions/qa-html-language-declarations#basics.",
          "id": "language",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "bestpractice"
          ],
          "title": "Declare the language code for your document",
          "weight": 3
        },
        "metaDescription": {
          "advice": "The meta description is too long. It has 156 characters, the recommended max is 155",
          "description": "Use a page description to make the page more relevant to search engines.",
          "id": "metaDescription",
          "offending": [
          ],
          "score": 50,
          "tags": [
            "bestpractice"
          ],
          "title": "Meta description",
          "weight": 5
        },
        "optimizely": {
          "advice": "",
          "description": "Use Optimizely with care because it hurts your performance since Javascript is loaded synchronously inside of the head tag, making the first paint happen later. Only turn on Optimzely (= load the javascript) when you run your A/B tests.",
          "id": "optimizely",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "bestpractice"
          ],
          "title": "Only use Optimizely when you need it",
          "weight": 2
        },
        "pageTitle": {
          "advice": "",
          "description": "Use a title to make the page more relevant to search engines.",
          "id": "pageTitle",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "bestpractice"
          ],
          "title": "Page title",
          "weight": 5
        },
        "spdy": {
          "advice": "",
          "description": "Chrome dropped supports for SPDY in Chrome 51, upgrade to HTTP/2 as soon as possible. The page has more users (browsers) supporting HTTP/2 than supports SPDY.",
          "id": "spdy",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "bestpractice"
          ],
          "title": "EOL for SPDY in Chrome",
          "weight": 1
        },
        "url": {
          "advice": "",
          "description": "A clean URL is good for the user and for SEO. Make them human readable, avoid too long URLs, spaces in the URL, too many request parameters, and never ever have the session id in your URL.",
          "id": "url",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "bestpractice"
          ],
          "title": "Have a good URL format",
          "weight": 2
        }
      },
      "score": 63
    },
    "info": {
      "amp": false,
      "browser": "Chrome 51.0.2704.103",
      "connectionType": "http/1",
      "documentHeight": 2176,
      "documentTitle": "Mayo Clinic",
      "documentWidth": 1050,
      "domDepth": {
        "avg": 10,
        "max": 17
      },
      "domElements": 493,
      "head": {
        "css": [
          "http://www.mayoclinic.org/styles/css/gbs/mayocombinded_7CB8F6255C9A30DA01E073A036EA827D.css",
          "http://www.mayoclinic.org/styles/css/gbs/mobile.css",
          "http://www.mayoclinic.org/~/media/Web/GBS/Shared/CSS/appointmentpromo.css"
        ],
        "jsasync": [
          "http://www.google-analytics.com/plugins/ua/linkid.js",
          "http://www.google-analytics.com/analytics.js",
          "http://nexus.ensighten.com/mayo_clinic/clinicprod/code/d9ba9f199ba3026f3354aa299561dceb.js?conditionId0=422860",
          "http://nexus.ensighten.com/mayo_clinic/clinicprod/code/7d37305a0b2a3f26c066e0a954168075.js?conditionId0=282458",
          "http://nexus.ensighten.com/mayo_clinic/clinicprod/code/1b2eb2e8b085b8e22128d3b9a87169ce.js?conditionId0=442751",
          "http://nexus.ensighten.com/mayo_clinic/clinicprod/code/5f128689f0638b86d5c8d3a5880030c7.js?conditionId0=373960",
          "http://oasc17.247realmedia.com/jp/www.mayoclinic.org/d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e/551293260/@Frame1?_RM_HTML_CALLBACK_=oas_tag.displayAds551293260&ct=PC_Organization_Web_Landing_Page&i=d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e",
          "http://nexus.ensighten.com/mayo_clinic/clinicprod/serverComponent.php?r=36264659.11860408&ClientID=640&PageID=http%3A%2F%2Fwww.mayoclinic.org%2F",
          "http://b.scorecardresearch.com/beacon.js",
          "http://oasc17.247realmedia.com/om/1.js"
        ],
        "jssync": [
          "http://www.mayoclinic.org/styles/js/gbs/mayoheaderjscombined_A718712FED7730A2386E2687514E8D03.js",
          "https://www.google.com/adsense/search/ads.js",
          "http://nexus.ensighten.com/mayo_clinic/clinicprod/Bootstrap.js"
        ]
      },
      "iframes": 0,
      "localStorageSize": 0,
      "pageContentSize": "1.2 MB",
      "pageContentTypes": {
        "css": {
          "contentSize": 277828,
          "headerSize": 963,
          "requests": 3,
          "transferSize": 46037
        },
        "favicon": {
          "contentSize": 3262,
          "headerSize": 370,
          "requests": 1,
          "transferSize": 3632
        },
        "font": {
          "contentSize": 0,
          "headerSize": 0,
          "requests": 0,
          "transferSize": 0
        },
        "html": {
          "contentSize": 31684,
          "headerSize": 807,
          "requests": 1,
          "transferSize": 11998
        },
        "image": {
          "contentSize": 274478,
          "headerSize": 7300,
          "requests": 24,
          "transferSize": 282093
        },
        "javascript": {
          "contentSize": 597019,
          "headerSize": 5007,
          "requests": 15,
          "transferSize": 191913
        }
      },
      "pageExpireStats": {
        "max": "10 years",
        "median": "1 week",
        "min": "0 second",
        "p10": "0 second",
        "p90": "2 weeks",
        "p99": "10 years"
      },
      "pageLastModifiedStats": {
        "max": "18 years",
        "median": "3 weeks",
        "min": "2 days",
        "p10": "4 days",
        "p90": "18 years",
        "p99": "18 years"
      },
      "pageRequests": 47,
      "pageTransferSize": "535.9 kB",
      "resourceHints": {
        "dns-prefetch": [
        ],
        "preconnect": [
        ],
        "prefetch": [
        ],
        "prerender": [
        ]
      },
      "responsive": true,
      "sessionStorageSize": 0,
      "windowSize": "1050x758"
    },
    "performance": {
      "adviceList": {
        "assetsRedirects": {
          "advice": "The page has 2 redirect(s). 2 request(s) are from other domains, it could be 3rd party assets that do redirects that they really don't need :(",
          "description": "A redirect is one extra step for the user to download the asset. Avoid that if you want to be fast. Redirects are even more showstoppers on mobile.",
          "id": "assetsRedirects",
          "offending": [
            "http://b.scorecardresearch.com/b?c1=2&c2=6035818&ns__t=1470500906820&ns_c=UTF-8&cv=3.1&c8=Mayo%20Clinic&c7=http%3A%2F%2Fwww.mayoclinic.org%2F&c9=",
            "http://oasc17.247realmedia.com/jp/www.mayoclinic.org/d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e/551293260/@Frame1?_RM_HTML_CALLBACK_=oas_tag.displayAds551293260&ct=PC_Organization_Web_Landing_Page&i=d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e"
          ],
          "score": 80,
          "tags": [
            "performance"
          ],
          "title": "Avoid doing redirects",
          "weight": 2
        },
        "avoidScalingImages": {
          "advice": "",
          "description": "It's easy to scale images in the browser and make sure they look good in different devices, however that is bad for performance! Scaling images in the browser takes extra CPU time and will hurt performance on mobile. And the user will download download extra kilobytes (sometime megabytes) of data that could be avoided. Don't do that, make sure you create multiple version of the same image serverside and serve the appropriate one.",
          "id": "avoidScalingImages",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "image"
          ],
          "title": "Don't scale images in the browser",
          "weight": 5
        },
        "cacheHeaders": {
          "advice": "The page has 11 request(s) that are missing a cache time. Configure a cache time so the browser doesn't need to download them every time. It will save 16.8 kB the next access.",
          "description": "The easiest way to make your page fast is to avoid doing requests to the server. Setting a cache header on your server response will tell the browser that it doesn't need to downloand the asset again during the configured cache time! Always try to set a cache time if the content doesn't change for every request.",
          "id": "cacheHeaders",
          "offending": [
            "http://www.mayoclinic.org/WebResource.axd?d=ybqrVgJggCTQ5424A98G-0IIuo2HP6QzhZz_JM9C6FvKgfPgyuvX_UToX6z4BPjUAbie_EvMN0-KXiz0udCRo1R4x5s1&t=635802997220000000",
            "http://oasc17.247realmedia.com/om/1.js",
            "http://www.mayoclinic.org/UniversalNav/Styles/img/bg_input_text.png",
            "http://www.mayoclinic.org/UniversalNav/Styles/img/icon-search.png",
            "http://nexus.ensighten.com/mayo_clinic/clinicprod/serverComponent.php?r=36264659.11860408&ClientID=640&PageID=http%3A%2F%2Fwww.mayoclinic.org%2F",
            "http://b.scorecardresearch.com/b?c1=2&c2=6035818&ns__t=1470500906820&ns_c=UTF-8&cv=3.1&c8=Mayo%20Clinic&c7=http%3A%2F%2Fwww.mayoclinic.org%2F&c9=",
            "http://oasc17.247realmedia.com/jp/www.mayoclinic.org/d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e/551293260/@Frame1?_RM_HTML_CALLBACK_=oas_tag.displayAds551293260&ct=PC_Organization_Web_Landing_Page&i=d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e",
            "http://b.scorecardresearch.com/b2?c1=2&c2=6035818&ns__t=1470500906820&ns_c=UTF-8&cv=3.1&c8=Mayo%20Clinic&c7=http%3A%2F%2Fwww.mayoclinic.org%2F&c9=",
            "http://oasc17.247realmedia.com/jp/www.mayoclinic.org/d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e/551293260/@Frame1?_RM_OAX_REDIR_&_RM_HTML_CALLBACK_=oas_tag.displayAds551293260&ct=PC_Organization_Web_Landing_Page&i=d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e",
            "https://stats.g.doubleclick.net/r/collect?t=dc&aip=1&_r=3&v=1&_v=j44&tid=UA-46648668-19&cid=1876894402.1470500907&jid=289255050&_u=CGCAiEIhB~&z=2074047307",
            "https://stats.g.doubleclick.net/r/collect?t=dc&aip=1&_r=3&v=1&_v=j44&tid=UA-46648668-3&cid=1876894402.1470500907&jid=1688874999&_u=CGCAiEIhB~&z=1430150234"
          ],
          "score": 0,
          "tags": [
            "performance",
            "server"
          ],
          "title": "Avoid extra requests by setting cache headers",
          "weight": 30
        },
        "cacheHeadersLong": {
          "advice": "The page has 27 request(s) that have a shorter cache time than 30 days (but still a cache time).",
          "description": "Setting a cache header is good. Setting a long cache header (at least 30 days) is even better beacause then it will stay long in the browser cache. But what do you do if that asset change? Rename it and the browser will pick up the new version.",
          "id": "cacheHeadersLong",
          "offending": [
            "http://www.mayoclinic.org/styles/css/gbs/mayocombinded_7CB8F6255C9A30DA01E073A036EA827D.css",
            "http://www.mayoclinic.org/~/media/Web/GBS/Shared/CSS/appointmentpromo.css",
            "http://www.mayoclinic.org/styles/js/gbs/mayoheaderjscombined_A718712FED7730A2386E2687514E8D03.js",
            "https://www.google.com/adsense/search/ads.js",
            "http://nexus.ensighten.com/mayo_clinic/clinicprod/Bootstrap.js",
            "http://www.mayoclinic.org/~/media/images/mayologo.png",
            "http://www.mayoclinic.org/styles/img/gbs/logo-mayoclinic-mobile.png",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-patientcare.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-docsdepts.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-research.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-meded.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-medprofs.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2014/04/29/12/35/globalnav-you-are-blue.jpg",
            "http://www.mayoclinic.org/~/media/KCMS/GBS/Patient%20Consumer/Images/2016/07/25/13/58/mc-banner_web1_960x400.jpg",
            "http://www.mayoclinic.org/~/media/KCMS/GBS/Patient%20Consumer/Images/2016/07/25/13/58/mc-banner_web2_960x400.jpg",
            "http://www.mayoclinic.org/styles/css/gbs/mobile.css",
            "http://www.mayoclinic.org/styles/js/gbs/mayofooterjscombined_E8608FEADED94BDF866FB5C825DDE681.js",
            "http://b.scorecardresearch.com/beacon.js",
            "http://www.mayoclinic.org/UniversalNav/Styles/img/bg-nav-arrow-down.png",
            "http://www.mayoclinic.org/UniversalNav/Styles/img/sprite-globalnav.png",
            "http://www.mayoclinic.org/UniversalNav/Styles/img/sprite-globalnavarrows.png",
            "http://www.mayoclinic.org/styles/css/gbs/img/icons.png",
            "http://www.mayoclinic.org/styles/img/gbs/patient/bg-patienttheme-appointments.png",
            "http://www.mayoclinic.org/~/media/Web/GBS/Shared/Images/bg-givenow.png",
            "http://www.mayoclinic.org/~/media/7FDA5EF55762400DB6B34C0929DC5A7C.png",
            "http://www.mayoclinic.org/styles/css/gbs/images/ui-bg_flat_75_ffffff_40x100.png",
            "http://www.mayoclinic.org/styles/img/gbs/shields.ico"
          ],
          "score": 73,
          "tags": [
            "performance",
            "server"
          ],
          "title": "Long cache headers is good",
          "weight": 3
        },
        "compressAssets": {
          "advice": "",
          "description": "In the early days of Internet there where browsers that didn't support compressing (gzipping) text content. They do now. Make sure you compress HTML, JSON, Javacript, CSS and SVG. I will save bytes for the user; making the page load faster and use less bandwith. ",
          "id": "compressAssets",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "server"
          ],
          "title": "Always compress text content",
          "weight": 8
        },
        "connectionKeepAlive": {
          "advice": "",
          "description": "Use keep alive headers & don't close the connection when we have multiple requests to the same domain. There has been some hacks in the past that suggested closing the connection as fast as possible and create new ones, but shouldn't be applicable anymore.",
          "id": "connectionKeepAlive",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "server"
          ],
          "title": "Don't close a connection that is used multiple times",
          "weight": 5
        },
        "cssPrint": {
          "advice": "",
          "description": "Loading a specific stylesheet for printing slows down the page, even though it is not used. You can include the print styles inside your other CSS file(s) just by using use @media type print.",
          "id": "cssPrint",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "css"
          ],
          "title": "Do not load specific print stylesheets.",
          "weight": 1
        },
        "cssSize": {
          "advice": "",
          "description": "Delivering a massive amount of CSS to the browser is not the best thing you can do, because it means more work for the browser when parsing the CSS against the HTML and that makes the rendering slower. Try to send only the CSS that is used on that page. And make sure to remove CSS rules when they aren't used anymore.",
          "id": "cssSize",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "css"
          ],
          "title": "Total CSS size shouldn't be too big",
          "weight": 5
        },
        "documentRedirect": {
          "advice": "",
          "description": "You should never ever redirect the main document, because it will make the page load slower for the user. Well you should redirect the  user if the user tries to use HTTP and there's a HTTPS version of the page. The coach check for that. :)",
          "id": "documentRedirect",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance"
          ],
          "title": "Avoid redirecting the main document",
          "weight": 9
        },
        "fastRender": {
          "advice": "The page has 3 render blocking CSS request(s) and 3 blocking JavaScript request(s) inside of head.",
          "description": "The critical rendering path is what the browser needs to do to start rendering the page. Every file requested inside of head element will postpone the rendering of the page, because the browser need to do the request. Avoid loading JavaScript synchronously inside of head (you should not need Javascript to render the page), request files from the same domain as the main document (to avoid DNS lookups) and inline CSS or server push for a really fast rendering and short rendering path.",
          "id": "fastRender",
          "offending": [
            "http://www.mayoclinic.org/styles/css/gbs/mayocombinded_7CB8F6255C9A30DA01E073A036EA827D.css",
            "http://www.mayoclinic.org/styles/css/gbs/mobile.css",
            "http://www.mayoclinic.org/~/media/Web/GBS/Shared/CSS/appointmentpromo.css",
            "http://www.mayoclinic.org/styles/js/gbs/mayoheaderjscombined_A718712FED7730A2386E2687514E8D03.js",
            "https://www.google.com/adsense/search/ads.js",
            "http://nexus.ensighten.com/mayo_clinic/clinicprod/Bootstrap.js"
          ],
          "score": 50,
          "tags": [
            "performance"
          ],
          "title": "Avoid slowing down the critical rendering path",
          "weight": 10
        },
        "favicon": {
          "advice": "",
          "description": "It is easy to make the favicon big but please avoid that, because every browser will download that. And make sure the cache headers is set for long time for the favicon, it is easy to miss since it's another content type.",
          "id": "favicon",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "favicon"
          ],
          "title": "The favicon should be small and cacheable",
          "weight": 1
        },
        "fewFonts": {
          "advice": "",
          "description": "How many fonts do you need on a page for the user to get the message? Fonts can slow down the rendering of content, try to avoid loading too many of them because worst case it can make the text invisible until they are loaded, best case they will flicker the text content when they arrive.",
          "id": "fewFonts",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "font"
          ],
          "title": "Avoid too many fonts",
          "weight": 2
        },
        "fewRequestsPerDomain": {
          "advice": "",
          "description": "Browsers have a limit on how many concurrent requests they can do per domain when using HTTP/1. When you hit the limit, the browser will wait before it can download more assets on that domain. So avoid having to many requests per domain.",
          "id": "fewRequestsPerDomain",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "HTTP/1"
          ],
          "title": "Avoid too many requests per domain [HTTP/1]",
          "weight": 5
        },
        "headerSize": {
          "advice": "",
          "description": "Avoid a lot of cookies and other stuff that makes your headers big when you use HTTP/1 because the headers are not compressed. You will send extra data to the user.",
          "id": "headerSize",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "mobile"
          ],
          "title": "Response headers should't be too big [HTTP/1]",
          "weight": 4
        },
        "imageSize": {
          "advice": "",
          "description": "Avoid having too many large images on page. The images will not affect the first paint of the page but it will eat bandwith for the user.",
          "id": "imageSize",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "image"
          ],
          "title": "Total image size shouldn't be too big",
          "weight": 5
        },
        "inlineCss": {
          "advice": "The page loads 3 CSS request(s) inside of head, try to inline the CSS for first render and lazy load the rest. ",
          "description": "In the early days of internet inlining CSS was one of the ugliest things you can do. That has changes if you want your page to start rendering fast for your user. Always inline the critical CSS when you use HTTP/1 (avoid doing CSS requests that blocks rendering) and lazy load and cache the rest of the CSS. Using HTTP/2 it is a little more complicated. Do your server support HTTP push? Then maybe that can help. Do you have a lot of users on a slow connection and serving large chunks of HTML? Then it could be better to inline, becasue some servers always prioritize HTML content over CSS so the user needs to download the HTML first, before the CSS is downloaded.  ",
          "id": "inlineCss",
          "offending": [
            "http://www.mayoclinic.org/styles/css/gbs/mayocombinded_7CB8F6255C9A30DA01E073A036EA827D.css",
            "http://www.mayoclinic.org/styles/css/gbs/mobile.css",
            "http://www.mayoclinic.org/~/media/Web/GBS/Shared/CSS/appointmentpromo.css"
          ],
          "score": 70,
          "tags": [
            "performance",
            "css"
          ],
          "title": "Inline CSS for faster first render on HTTP/1",
          "weight": 7
        },
        "javascriptSize": {
          "advice": "The total JavaScript transfer size is 191.9 kB and the uncompressed size is 597 kB. This is too much. You need to remove as much as possible.",
          "description": "A lot of JavaScript often means you are downloading more than you need. How complex is the page and what can the user do on the page? Do you use multiple Javascript frameworks?",
          "id": "javascriptSize",
          "offending": [
          ],
          "score": 0,
          "tags": [
            "performance",
            "javascript"
          ],
          "title": "Total JavaScript size shouldn't be too big",
          "weight": 5
        },
        "jquery": {
          "advice": "",
          "description": "There sites out there that uses multiple version of JQuery on the same page. You shouldn't do that because the user will then download extra amount of data that could be avoided. Cleanup the code and make sure you only use one version.",
          "id": "jquery",
          "offending": [
            "1.10.2"
          ],
          "score": 100,
          "tags": [
            "jQuery",
            "performance"
          ],
          "title": "Avoid using more than one jQuery version per page",
          "weight": 4
        },
        "optimalCssSize": {
          "advice": "http://www.mayoclinic.org/styles/css/gbs/mayocombinded_7CB8F6255C9A30DA01E073A036EA827D.css size is 36.7 kB (36729) and that is bigger than the limit of 14.5 kB. Try to make the CSS files fit into 14.5 kb.",
          "description": "Make CSS responses small to fit into the magic number TCP window size 14.5 kB. The browser can then download the CSS faster and that will make the page start render earlier.",
          "id": "optimalCssSize",
          "offending": [
            "http://www.mayoclinic.org/styles/css/gbs/mayocombinded_7CB8F6255C9A30DA01E073A036EA827D.css"
          ],
          "score": 90,
          "tags": [
            "performance",
            "css"
          ],
          "title": "Make each CSS response small",
          "weight": 3
        },
        "pageSize": {
          "advice": "",
          "description": "Avoid having pages that have transfer size over the wire of more than 2 MB (desktop) and 1 MB (mobile) because that is really big and will hurt performance and will make the page expensive for the user if she/he pays for the bandwith.",
          "id": "pageSize",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "mobile"
          ],
          "title": "Total page size shouldn't be too big",
          "weight": 3
        },
        "privateAssets": {
          "advice": "The page has 19 request(s) with private headers. Make sure that the assets really should be private and only used by one user. Else make it cacheable for everyone.",
          "description": "If you set private headers on content, that means that the content are specific for that user. Static content should be able to be cached & used by everyone, avoid setting the cache header to private.",
          "id": "privateAssets",
          "offending": [
            "http://www.mayoclinic.org/~/media/Web/GBS/Shared/CSS/appointmentpromo.css",
            "https://www.google.com/adsense/search/ads.js",
            "http://www.mayoclinic.org/~/media/images/mayologo.png",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-patientcare.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-docsdepts.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-research.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-meded.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2013/05/02/10/56/globalnav-medprofs.jpg",
            "http://www.mayoclinic.org/~/media/kcms/gbs/research/images/2014/04/29/12/35/globalnav-you-are-blue.jpg",
            "http://www.mayoclinic.org/~/media/KCMS/GBS/Patient%20Consumer/Images/2016/07/25/13/58/mc-banner_web1_960x400.jpg",
            "http://www.mayoclinic.org/~/media/KCMS/GBS/Patient%20Consumer/Images/2016/07/25/13/58/mc-banner_web2_960x400.jpg",
            "http://oasc17.247realmedia.com/om/1.js",
            "http://b.scorecardresearch.com/beacon.js",
            "http://www.mayoclinic.org/UniversalNav/Styles/img/bg_input_text.png",
            "http://www.mayoclinic.org/UniversalNav/Styles/img/icon-search.png",
            "http://www.mayoclinic.org/~/media/Web/GBS/Shared/Images/bg-givenow.png",
            "http://www.mayoclinic.org/~/media/7FDA5EF55762400DB6B34C0929DC5A7C.png",
            "http://oasc17.247realmedia.com/jp/www.mayoclinic.org/d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e/551293260/@Frame1?_RM_HTML_CALLBACK_=oas_tag.displayAds551293260&ct=PC_Organization_Web_Landing_Page&i=d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e",
            "http://oasc17.247realmedia.com/jp/www.mayoclinic.org/d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e/551293260/@Frame1?_RM_OAX_REDIR_&_RM_HTML_CALLBACK_=oas_tag.displayAds551293260&ct=PC_Organization_Web_Landing_Page&i=d0cbeea4-9dd5-475c-93aa-1b87c9e02a6e"
          ],
          "score": 0,
          "tags": [
            "performance",
            "server"
          ],
          "title": "Don't use private headers on static content",
          "weight": 5
        },
        "responseOk": {
          "advice": "",
          "description": "Your page you should never request assets that returns a 400 or 500 error. These requests are never cached, they will be done everytime from the browser. If that happens something is broken, please fix it.",
          "id": "responseOk",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "server"
          ],
          "title": "Avoid missing and error requests",
          "weight": 7
        },
        "spof": {
          "advice": "The page has 2 requests inside of head that can cause a SPOF. Load them asynchronously or move them outside of document head.",
          "description": "A page can be stopped to be loaded in the browser, if a single Javascript, CSS and in some cases a font couldn't be fetched or loading really slow (the white screen of death). That is something you really want to avoid. Never load 3rd party components synchronously inside of the head tag.",
          "id": "spof",
          "offending": [
            "https://www.google.com/adsense/search/ads.js",
            "http://nexus.ensighten.com/mayo_clinic/clinicprod/Bootstrap.js"
          ],
          "score": 80,
          "tags": [
            "performance",
            "css",
            "js"
          ],
          "title": "Avoid Frontend single point of failures",
          "weight": 7
        },
        "thirdPartyAsyncJs": {
          "advice": "",
          "description": "Use JavaScript snippets that load the JS files asynchronously in order to speed up the user experience and avoid blocking the initial load.",
          "id": "thirdPartyAsyncJs",
          "offending": [
          ],
          "score": 100,
          "tags": [
            "performance",
            "js"
          ],
          "title": "Always load third-party JavaScript asynchronously",
          "weight": 5
        },
        "userTiming": {
          "advice": "Start using the User Timing API to measure specifics metrics for your page.",
          "description": "The User Timing API is a perfect way to start measuring specific and custom metrics for your site. Use it.",
          "id": "userTiming",
          "offending": [
          ],
          "score": 0,
          "tags": [
            "performance"
          ],
          "title": "Use the User Timing API to check your performance",
          "weight": 1
        }
      },
      "score": 64
    },
    "score": 66,
    "timings": {
      "firstPaint": 791.088104248047,
      "fullyLoaded": 1223.95,
      "navigationTimings": {
        "connectEnd": 61,
        "connectStart": 14,
        "domComplete": 1147,
        "domContentLoadedEventEnd": 775,
        "domContentLoadedEventStart": 699,
        "domInteractive": 699,
        "domLoading": 246,
        "domainLookupEnd": 14,
        "domainLookupStart": 2,
        "fetchStart": 0,
        "loadEventEnd": 1162,
        "loadEventStart": 1147,
        "navigationStart": 0,
        "requestStart": 61,
        "responseEnd": 283,
        "responseStart": 235
      },
      "rumSpeedIndex": 1090.52073249103,
      "timings": {
        "backEndTime": 235,
        "domContentLoadedTime": 699,
        "domInteractiveTime": 699,
        "domainLookupTime": 12,
        "frontEndTime": 864,
        "pageDownloadTime": 48,
        "pageLoadTime": 1147,
        "redirectionTime": 0,
        "serverConnectionTime": 47,
        "serverResponseTime": 222
      },
      "userTimings": {
        "marks": [
        ],
        "measures": [
        ]
      }
    }
  },
  "errors": {
  },
  "url": "http://www.mayoclinic.org/",
  "version": "0.24.2"
}
soulgalore commented 8 years ago

Hey @bronzehedwick it works like this: If you use Chrome we pick up the HTTP/2 info from window.chrome.loadTimes().connectionInfo. If you use Firefox we get it from the Resource Timing API v2 (https://github.com/sitespeedio/coach/blob/master/lib/dom/util.js#L78) by trying to find assets that loads on the same domain as the main document (we would need Navigation Timing V2 to be able to get the status on the main document, there's a "bug" reported for Firefox). So if you test with Firefox, it could be some error in the logic in the Coach. In Chrome the problem is from Chrome.

I didn't fully follow the error, is it httpsH2 that gives 100 in score? Like that advice shouldn't be in the result or what's the error?

Best Peter

bronzehedwick commented 8 years ago

Yes, the error is that httpsH2 gives a 100 score, when the page isn't actually served over HTTP/2.

Thanks for the clarity on firefox vs chrome. I tried running the test using firefox, but it just opened the browser with a new tab and hung there, webcoach seemingly never taking over the process. I had to kill the job from the command line. Using firefox 48.

soulgalore commented 8 years ago

Hey @bronzehedwick , yep I see your point, let see how we can fix that. Need to find a pattern to remove the advice.

About Firefox, it's broken with Selenium right now :( https://github.com/sitespeedio/sitespeed.io/issues/1109

bronzehedwick commented 8 years ago

Ah, gotcha.

Thanks for looking into this!

soulgalore commented 8 years ago

FYI: upgraded and fixed Firefox.

bronzehedwick commented 8 years ago

Just tested, and I can confirm that Firefox works. Thanks!