Skip to content

Instantly share code, notes, and snippets.

@shawnbot
Created March 3, 2017 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawnbot/3ebbdea9a0a3fa59578d573543f5cea9 to your computer and use it in GitHub Desktop.
Save shawnbot/3ebbdea9a0a3fa59578d573543f5cea9 to your computer and use it in GitHub Desktop.
Sample JSON output from the Google PageSpeed Insights API for standards.usa.gov
{
"kind": "pagespeedonline#result",
"id": "https://standards.usa.gov/",
"responseCode": 200,
"title": "U.S. Web Design Standards Documentation | Announcing version 1.0",
"ruleGroups": {
"SPEED": {
"score": 66
},
"USABILITY": {
"score": 100
}
},
"pageStats": {
"numberResources": 24,
"numberHosts": 3,
"totalRequestBytes": "2414",
"numberStaticResources": 17,
"htmlResponseBytes": "16134",
"cssResponseBytes": "123982",
"imageResponseBytes": "253262",
"javascriptResponseBytes": "162183",
"otherResponseBytes": "75292",
"numberJsResources": 4,
"numberCssResources": 1
},
"formattedResults": {
"locale": "en_US",
"ruleResults": {
"AvoidLandingPageRedirects": {
"localizedRuleName": "Avoid landing page redirects",
"ruleImpact": 0,
"groups": [
"SPEED"
],
"summary": {
"format": "Your page has no redirects. Learn more about {{BEGIN_LINK}}avoiding landing page redirects{{END_LINK}}.",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/AvoidRedirects"
}
]
}
},
"AvoidPlugins": {
"localizedRuleName": "Avoid plugins",
"ruleImpact": 0,
"groups": [
"USABILITY"
],
"summary": {
"format": "Your page does not appear to use plugins, which would prevent content from being usable on many platforms. Learn more about the importance of {{BEGIN_LINK}}avoiding plugins{{END_LINK}}.",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/AvoidPlugins"
}
]
}
},
"ConfigureViewport": {
"localizedRuleName": "Configure the viewport",
"ruleImpact": 0,
"groups": [
"USABILITY"
],
"summary": {
"format": "Your page specifies a viewport matching the device's size, which allows it to render properly on all devices. Learn more about {{BEGIN_LINK}}configuring viewports{{END_LINK}}.",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/ConfigureViewport"
}
]
}
},
"EnableGzipCompression": {
"localizedRuleName": "Enable compression",
"ruleImpact": 0.2239,
"groups": [
"SPEED"
],
"summary": {
"format": "Compressing resources with gzip or deflate can reduce the number of bytes sent over the network."
},
"urlBlocks": [
{
"header": {
"format": "{{BEGIN_LINK}}Enable compression{{END_LINK}} for the following resources to reduce their transfer size by {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/EnableCompression"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "729B"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "51%"
}
]
},
"urls": [
{
"result": {
"format": "Compressing {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/assets/img/external-link.svg"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "729B"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "51%"
}
]
}
}
]
}
]
},
"LeverageBrowserCaching": {
"localizedRuleName": "Leverage browser caching",
"ruleImpact": 12.625,
"groups": [
"SPEED"
],
"summary": {
"format": "Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network."
},
"urlBlocks": [
{
"header": {
"format": "{{BEGIN_LINK}}Leverage browser caching{{END_LINK}} for the following cacheable resources:",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/LeverageBrowserCaching"
}
]
},
"urls": [
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/assets/img/angle-arrow-down-primary.svg"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/assets/img/close.svg"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/assets/img/external-link.svg"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/assets/img/favicons/favicon-57.png"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/assets/img/icon-dot-gov.svg"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/assets/img/icon-https.svg"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/assets/img/plus-alt.svg"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/assets/js/styleguide.js"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/assets/js/vendor/uswds.min.js"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/css/styleguide.css"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/img/home/fireworks.jpg"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/img/logo-18f.png"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/img/logo-email.png"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/img/logo-github.png"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/img/logo-gsa.png"
}
]
}
},
{
"result": {
"format": "{{URL}} (expiration not specified)",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/img/logo-slack.png"
}
]
}
},
{
"result": {
"format": "{{URL}} ({{LIFETIME}})",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://www.google-analytics.com/analytics.js"
},
{
"type": "DURATION",
"key": "LIFETIME",
"value": "2 hours"
}
]
}
}
]
}
]
},
"MainResourceServerResponseTime": {
"localizedRuleName": "Reduce server response time",
"ruleImpact": 0,
"groups": [
"SPEED"
],
"summary": {
"format": "Your server responded quickly. Learn more about {{BEGIN_LINK}}server response time optimization{{END_LINK}}.",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/Server"
}
]
}
},
"MinifyCss": {
"localizedRuleName": "Minify CSS",
"ruleImpact": 0.3951,
"groups": [
"SPEED"
],
"summary": {
"format": "Compacting CSS code can save many bytes of data and speed up download and parse times."
},
"urlBlocks": [
{
"header": {
"format": "{{BEGIN_LINK}}Minify CSS{{END_LINK}} for the following resources to reduce their size by {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/MinifyResources"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "3.9KiB"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "22%"
}
]
},
"urls": [
{
"result": {
"format": "Minifying {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction) after compression.",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/css/styleguide.css"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "3.9KiB"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "22%"
}
]
}
}
]
}
]
},
"MinifyHTML": {
"localizedRuleName": "Minify HTML",
"ruleImpact": 0.06670000000000001,
"groups": [
"SPEED"
],
"summary": {
"format": "Compacting HTML code, including any inline JavaScript and CSS contained in it, can save many bytes of data and speed up download and parse times."
},
"urlBlocks": [
{
"header": {
"format": "{{BEGIN_LINK}}Minify HTML{{END_LINK}} for the following resources to reduce their size by {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/MinifyResources"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "667B"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "16%"
}
]
},
"urls": [
{
"result": {
"format": "Minifying {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction) after compression.",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "667B"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "16%"
}
]
}
}
]
}
]
},
"MinifyJavaScript": {
"localizedRuleName": "Minify JavaScript",
"ruleImpact": 0,
"groups": [
"SPEED"
],
"summary": {
"format": "Your JavaScript content is minified. Learn more about {{BEGIN_LINK}}minifying JavaScript{{END_LINK}}.",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/MinifyResources"
}
]
}
},
"MinimizeRenderBlockingResources": {
"localizedRuleName": "Eliminate render-blocking JavaScript and CSS in above-the-fold content",
"ruleImpact": 32,
"groups": [
"SPEED"
],
"summary": {
"format": "Your page has {{NUM_SCRIPTS}} blocking script resources and {{NUM_CSS}} blocking CSS resources. This causes a delay in rendering your page.",
"args": [
{
"type": "INT_LITERAL",
"key": "NUM_SCRIPTS",
"value": "1"
},
{
"type": "INT_LITERAL",
"key": "NUM_CSS",
"value": "1"
}
]
},
"urlBlocks": [
{
"header": {
"format": "None of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources, or inline the critical portions of those resources directly in the HTML."
}
},
{
"header": {
"format": "{{BEGIN_LINK}}Remove render-blocking JavaScript{{END_LINK}}:",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/BlockingJS"
}
]
},
"urls": [
{
"result": {
"format": "{{URL}}",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=GSA"
}
]
}
}
]
},
{
"header": {
"format": "{{BEGIN_LINK}}Optimize CSS Delivery{{END_LINK}} of the following:",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery"
}
]
},
"urls": [
{
"result": {
"format": "{{URL}}",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/css/styleguide.css"
}
]
}
}
]
}
]
},
"OptimizeImages": {
"localizedRuleName": "Optimize images",
"ruleImpact": 7.458400000000001,
"groups": [
"SPEED"
],
"summary": {
"format": "Properly formatting and compressing images can save many bytes of data."
},
"urlBlocks": [
{
"header": {
"format": "{{BEGIN_LINK}}Optimize the following images{{END_LINK}} to reduce their size by {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/OptimizeImages"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "72.8KiB"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "32%"
}
]
},
"urls": [
{
"result": {
"format": "Compressing {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/img/home/fireworks.jpg"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "45.1KiB"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "23%"
}
]
}
},
{
"result": {
"format": "Compressing and resizing {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/img/logo-slack.png"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "16.9KiB"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "96%"
}
]
}
},
{
"result": {
"format": "Compressing and resizing {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/img/logo-email.png"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "7.3KiB"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "96%"
}
]
}
},
{
"result": {
"format": "Compressing {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/img/logo-18f.png"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "2.6KiB"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "59%"
}
]
}
},
{
"result": {
"format": "Compressing {{URL}} could save {{SIZE_IN_BYTES}} ({{PERCENTAGE}} reduction).",
"args": [
{
"type": "URL",
"key": "URL",
"value": "https://standards.usa.gov/img/logo-github.png"
},
{
"type": "BYTES",
"key": "SIZE_IN_BYTES",
"value": "891B"
},
{
"type": "PERCENTAGE",
"key": "PERCENTAGE",
"value": "56%"
}
]
}
}
]
}
]
},
"PrioritizeVisibleContent": {
"localizedRuleName": "Prioritize visible content",
"ruleImpact": 0,
"groups": [
"SPEED"
],
"summary": {
"format": "You have the above-the-fold content properly prioritized. Learn more about {{BEGIN_LINK}}prioritizing visible content{{END_LINK}}.",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/PrioritizeVisibleContent"
}
]
}
},
"SizeContentToViewport": {
"localizedRuleName": "Size content to viewport",
"ruleImpact": 0,
"groups": [
"USABILITY"
],
"summary": {
"format": "The contents of your page fit within the viewport. Learn more about {{BEGIN_LINK}}sizing content to the viewport{{END_LINK}}.",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/SizeContentToViewport"
}
]
}
},
"SizeTapTargetsAppropriately": {
"localizedRuleName": "Size tap targets appropriately",
"ruleImpact": 0,
"groups": [
"USABILITY"
],
"summary": {
"format": "All of your page's links/buttons are large enough for a user to easily tap on a touchscreen. Learn more about {{BEGIN_LINK}}sizing tap targets appropriately{{END_LINK}}.",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/SizeTapTargetsAppropriately"
}
]
}
},
"UseLegibleFontSizes": {
"localizedRuleName": "Use legible font sizes",
"ruleImpact": 0,
"groups": [
"USABILITY"
],
"summary": {
"format": "The text on your page is legible. Learn more about {{BEGIN_LINK}}using legible font sizes{{END_LINK}}.",
"args": [
{
"type": "HYPERLINK",
"key": "LINK",
"value": "https://developers.google.com/speed/docs/insights/UseLegibleFontSizes"
}
]
}
}
}
},
"version": {
"major": 1,
"minor": 15
}
}
@kos08001
Copy link

How do you get the mobile score?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment