SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Manual Google PageSpeed
Install google APIS node.js
npm install googleapis --save
Install PageSpeed Insights with reporting
npm install --save psi
Usage
var psi = require('psi');
// get the PageSpeed Insights report
psi('html5rocks.com', function (err, data) {
console.log(data.score);
console.log(data.pageStats);
});
// output a formatted report to the terminal
psi.output('html5rocks.com', function (err) {
console.log('done');
});
API
psi(url, [options], callback)
url
Required
Type: string
URL of the page for which the PageSpeed Insights API should generate results.
options
Type: object
key
Type: string
Default: Free tier
When using this module for a production-level build process, registering for an API
key from theGoogle Developer Console is recommended.
strategy
Type: string
Default: mobile
Values: mobile, desktop
Strategy to use when analyzing the page.
locale
Type: string
Default: en_US
Locale results should be generated in.
threshold
Type: number
Default: 70
Threshold score to pass the PageSpeed test.
callback(error, data)
Required
Type: function
data
Type: object
The response from Google PageSpeed Insights.
psi.output(url, [options], [callback])
Output the formatted report to the terminal.
url and options is the same as psi().
callback(error)
Type: function
Install CLI
$ npm install --global psi
$ psi --help
Usage
psi <url> <options>
Example
psi todomvc.com --strategy=mobile
Options
--key Google API Key. By default the free tier is used.
--strategy Strategy to use when analyzing the page: mobile|desktop
--format Output format: cli|json|tap
--locale Locale results should be generated in.
--threshold Threshold score to pass the PageSpeed test.
Install grunt-pagespeed
npm install grunt-pagespeed --save-dev
Loading the plugin
Add this to your project's Gruntfile.js gruntfile:
grunt.loadNpmTasks('grunt-pagespeed');
Or, add this to your project's Gruntfile.coffee gruntfile:
grunt.loadNpmTasks 'grunt-pagespeed'
Alternatively use load-grunt-tasks to load your plugins.
require('load-grunt-tasks')(grunt);
Pagespeed task
Run this task with the grunt pagespeed command.
This task is a multi task so any targets, files and options should be specified
according to the multi taskdocumentation.
Usage Example
pagespeed: {
options: {
nokey: true,
url: "https://developers.google.com"
},
prod: {
options: {
url:
"https://developers.google.com/speed/docs/insights/v1/getting_started",
locale: "en_GB",
strategy: "desktop",
threshold: 80
}
},
paths: {
options: {
paths: ["/speed/docs/insights/v1/getting_started", "/speed/docs/about"],
locale: "en_GB",
strategy: "desktop",
threshold: 80
}
}
}
Options
nokey
Type: Boolean
Use the nokey option to test-drive PageSpeed Insights before acquiring a key for
production builds.
key
Type: String
Google API Key
url
Type: String
The URL of the page for which the PageSpeed Insights API should generate
results.
Target Properties
url
Type: String
The URL of the page for which the PageSpeed Insights API should generate
results.
locale
Type: String
The locale that results should be generated in. This is mandatory.
strategy
Type: String
The strategy to use when analyzing the page. Valid values are desktop and mobile.
threshold
Type: Number
Threshold score that is needed to pass the pagespeed test
paths
Type: Array
An array of URL paths that are appended to the URL
Sample output
The grunt task outputs the results as follows if everything passes:
If the task fails to pass the threshold, then it ouputs something similar to the image
below:
Manual google page speed

Weitere ähnliche Inhalte

Was ist angesagt?

HPEC 2021 grblas
HPEC 2021 grblasHPEC 2021 grblas
HPEC 2021 grblasErikWelch2
 
Portable class library to .NET Standard Extension
Portable class library to .NET Standard ExtensionPortable class library to .NET Standard Extension
Portable class library to .NET Standard ExtensionTakeshi Fujimoto
 
Dev toolkit: Ferramentas para melhorar a qualidade do seu projeto
Dev toolkit: Ferramentas para melhorar a qualidade do seu projetoDev toolkit: Ferramentas para melhorar a qualidade do seu projeto
Dev toolkit: Ferramentas para melhorar a qualidade do seu projetoEduardo Pittol
 
Optimizing and Deploying Angular
Optimizing and Deploying AngularOptimizing and Deploying Angular
Optimizing and Deploying AngularJohn Papa
 
Replacing Rails asset pipeline with Gulp
Replacing Rails asset pipeline with GulpReplacing Rails asset pipeline with Gulp
Replacing Rails asset pipeline with GulpTomasz Bak
 
I am-one-with-angular
I am-one-with-angularI am-one-with-angular
I am-one-with-angularJohn Papa
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.jsBo-Yi Wu
 
Web performance tools @ WebPerf.camp 2016
Web performance tools @ WebPerf.camp 2016Web performance tools @ WebPerf.camp 2016
Web performance tools @ WebPerf.camp 2016SergeyChernyshev
 
Automating Large Applications on Modular and Structured Form with Gulp
Automating Large Applications on Modular and Structured Form with GulpAutomating Large Applications on Modular and Structured Form with Gulp
Automating Large Applications on Modular and Structured Form with GulpAnderson Aguiar
 
Gulp and bower Implementation
Gulp and bower Implementation Gulp and bower Implementation
Gulp and bower Implementation Prashant Shrestha
 
Groovy on Google App Engine with Gaelyk
Groovy on Google App Engine with GaelykGroovy on Google App Engine with Gaelyk
Groovy on Google App Engine with GaelykKevin H.A. Tan
 
So you want to write a cloud function
So you want to write a cloud functionSo you want to write a cloud function
So you want to write a cloud functionElad Hirsch
 
Kubeflow on google kubernetes engine
Kubeflow on google kubernetes engineKubeflow on google kubernetes engine
Kubeflow on google kubernetes engineBear Su
 
JVM Web Frameworks Exploration
JVM Web Frameworks ExplorationJVM Web Frameworks Exploration
JVM Web Frameworks ExplorationKevin H.A. Tan
 
GCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionGCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionSimon Su
 
Makefiles for automating image processing
Makefiles for  automating  image processingMakefiles for  automating  image processing
Makefiles for automating image processingShweta Sadawarte
 

Was ist angesagt? (19)

Gulp - The Streaming Build System
Gulp - The Streaming Build SystemGulp - The Streaming Build System
Gulp - The Streaming Build System
 
HPEC 2021 grblas
HPEC 2021 grblasHPEC 2021 grblas
HPEC 2021 grblas
 
Portable class library to .NET Standard Extension
Portable class library to .NET Standard ExtensionPortable class library to .NET Standard Extension
Portable class library to .NET Standard Extension
 
Dev toolkit: Ferramentas para melhorar a qualidade do seu projeto
Dev toolkit: Ferramentas para melhorar a qualidade do seu projetoDev toolkit: Ferramentas para melhorar a qualidade do seu projeto
Dev toolkit: Ferramentas para melhorar a qualidade do seu projeto
 
Optimizing and Deploying Angular
Optimizing and Deploying AngularOptimizing and Deploying Angular
Optimizing and Deploying Angular
 
Replacing Rails asset pipeline with Gulp
Replacing Rails asset pipeline with GulpReplacing Rails asset pipeline with Gulp
Replacing Rails asset pipeline with Gulp
 
I am-one-with-angular
I am-one-with-angularI am-one-with-angular
I am-one-with-angular
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.js
 
Web performance tools @ WebPerf.camp 2016
Web performance tools @ WebPerf.camp 2016Web performance tools @ WebPerf.camp 2016
Web performance tools @ WebPerf.camp 2016
 
Automating Large Applications on Modular and Structured Form with Gulp
Automating Large Applications on Modular and Structured Form with GulpAutomating Large Applications on Modular and Structured Form with Gulp
Automating Large Applications on Modular and Structured Form with Gulp
 
Gulp and bower Implementation
Gulp and bower Implementation Gulp and bower Implementation
Gulp and bower Implementation
 
Groovy on Google App Engine with Gaelyk
Groovy on Google App Engine with GaelykGroovy on Google App Engine with Gaelyk
Groovy on Google App Engine with Gaelyk
 
So you want to write a cloud function
So you want to write a cloud functionSo you want to write a cloud function
So you want to write a cloud function
 
Kubeflow on google kubernetes engine
Kubeflow on google kubernetes engineKubeflow on google kubernetes engine
Kubeflow on google kubernetes engine
 
JVM Web Frameworks Exploration
JVM Web Frameworks ExplorationJVM Web Frameworks Exploration
JVM Web Frameworks Exploration
 
Cheap HPC
Cheap HPCCheap HPC
Cheap HPC
 
GCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionGCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow Introduction
 
Desktop Summit 2011 Talk
Desktop Summit 2011 TalkDesktop Summit 2011 Talk
Desktop Summit 2011 Talk
 
Makefiles for automating image processing
Makefiles for  automating  image processingMakefiles for  automating  image processing
Makefiles for automating image processing
 

Andere mochten auch (8)

The Non Diet Approach
The Non Diet ApproachThe Non Diet Approach
The Non Diet Approach
 
An Educational Timeline: One Library's Involvement in Undergraduate Medical E...
An Educational Timeline: One Library's Involvement in Undergraduate Medical E...An Educational Timeline: One Library's Involvement in Undergraduate Medical E...
An Educational Timeline: One Library's Involvement in Undergraduate Medical E...
 
WordCamp Dayton 2015
WordCamp Dayton 2015WordCamp Dayton 2015
WordCamp Dayton 2015
 
Zinn Curriculum Vitae 2015
Zinn Curriculum Vitae 2015Zinn Curriculum Vitae 2015
Zinn Curriculum Vitae 2015
 
DIY WEBSITE MARKETING
DIY WEBSITE MARKETINGDIY WEBSITE MARKETING
DIY WEBSITE MARKETING
 
MLA CE: The Diversity of Data Management: Practical Approaches Recorded Webca...
MLA CE: The Diversity of Data Management: Practical Approaches Recorded Webca...MLA CE: The Diversity of Data Management: Practical Approaches Recorded Webca...
MLA CE: The Diversity of Data Management: Practical Approaches Recorded Webca...
 
7 most difficult to-counterfeit banknotes in the world
7 most difficult to-counterfeit banknotes in the world7 most difficult to-counterfeit banknotes in the world
7 most difficult to-counterfeit banknotes in the world
 
DNA? — an exploration of 23andMe for health
DNA? — an exploration of 23andMe for healthDNA? — an exploration of 23andMe for health
DNA? — an exploration of 23andMe for health
 

Ähnlich wie Manual google page speed

Grunt & Front-end Workflow
Grunt & Front-end WorkflowGrunt & Front-end Workflow
Grunt & Front-end WorkflowPagepro
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLP Community
 
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기SuJang Yang
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and PracticeBo-Yi Wu
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastAtlassian
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoJames Casey
 
Using the new WordPress REST API
Using the new WordPress REST APIUsing the new WordPress REST API
Using the new WordPress REST APICaldera Labs
 
Web development - technologies and tools
Web development - technologies and toolsWeb development - technologies and tools
Web development - technologies and toolsYoann Gotthilf
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloudwesley chun
 
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...Technical Tips: Visual Regression Testing and Environment Comparison with Bac...
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...Building Blocks
 
Gae Meets Django
Gae Meets DjangoGae Meets Django
Gae Meets Djangofool2nd
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code維佋 唐
 
Node in Production at Aviary
Node in Production at AviaryNode in Production at Aviary
Node in Production at AviaryAviary
 
Infrastructure Management in GCP
Infrastructure Management in GCPInfrastructure Management in GCP
Infrastructure Management in GCPDana Hoffman
 
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko "Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko Fwdays
 
Laravel5 Introduction and essentials
Laravel5 Introduction and essentialsLaravel5 Introduction and essentials
Laravel5 Introduction and essentialsPramod Kadam
 
MongoDB Europe 2016 - Warehousing MongoDB Data using Apache Beam and BigQuery
MongoDB Europe 2016 - Warehousing MongoDB Data using Apache Beam and BigQueryMongoDB Europe 2016 - Warehousing MongoDB Data using Apache Beam and BigQuery
MongoDB Europe 2016 - Warehousing MongoDB Data using Apache Beam and BigQueryMongoDB
 
How We Build NG-MY Websites: Performance, SEO, CI, CD (Thai version)
How We Build NG-MY Websites: Performance, SEO, CI, CD (Thai version)How We Build NG-MY Websites: Performance, SEO, CI, CD (Thai version)
How We Build NG-MY Websites: Performance, SEO, CI, CD (Thai version)Seven Peaks Speaks
 
How We Build NG-MY Websites: Performance, SEO, CI, CD
How We Build NG-MY Websites: Performance, SEO, CI, CDHow We Build NG-MY Websites: Performance, SEO, CI, CD
How We Build NG-MY Websites: Performance, SEO, CI, CDSeven Peaks Speaks
 

Ähnlich wie Manual google page speed (20)

Grunt & Front-end Workflow
Grunt & Front-end WorkflowGrunt & Front-end Workflow
Grunt & Front-end Workflow
 
Google Gears
Google GearsGoogle Gears
Google Gears
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App Development
 
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and Practice
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Using the new WordPress REST API
Using the new WordPress REST APIUsing the new WordPress REST API
Using the new WordPress REST API
 
Web development - technologies and tools
Web development - technologies and toolsWeb development - technologies and tools
Web development - technologies and tools
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloud
 
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...Technical Tips: Visual Regression Testing and Environment Comparison with Bac...
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...
 
Gae Meets Django
Gae Meets DjangoGae Meets Django
Gae Meets Django
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 
Node in Production at Aviary
Node in Production at AviaryNode in Production at Aviary
Node in Production at Aviary
 
Infrastructure Management in GCP
Infrastructure Management in GCPInfrastructure Management in GCP
Infrastructure Management in GCP
 
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko "Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
 
Laravel5 Introduction and essentials
Laravel5 Introduction and essentialsLaravel5 Introduction and essentials
Laravel5 Introduction and essentials
 
MongoDB Europe 2016 - Warehousing MongoDB Data using Apache Beam and BigQuery
MongoDB Europe 2016 - Warehousing MongoDB Data using Apache Beam and BigQueryMongoDB Europe 2016 - Warehousing MongoDB Data using Apache Beam and BigQuery
MongoDB Europe 2016 - Warehousing MongoDB Data using Apache Beam and BigQuery
 
How We Build NG-MY Websites: Performance, SEO, CI, CD (Thai version)
How We Build NG-MY Websites: Performance, SEO, CI, CD (Thai version)How We Build NG-MY Websites: Performance, SEO, CI, CD (Thai version)
How We Build NG-MY Websites: Performance, SEO, CI, CD (Thai version)
 
How We Build NG-MY Websites: Performance, SEO, CI, CD
How We Build NG-MY Websites: Performance, SEO, CI, CDHow We Build NG-MY Websites: Performance, SEO, CI, CD
How We Build NG-MY Websites: Performance, SEO, CI, CD
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Kürzlich hochgeladen (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Manual google page speed

  • 1. Manual Google PageSpeed Install google APIS node.js npm install googleapis --save Install PageSpeed Insights with reporting npm install --save psi Usage var psi = require('psi'); // get the PageSpeed Insights report psi('html5rocks.com', function (err, data) { console.log(data.score); console.log(data.pageStats); }); // output a formatted report to the terminal psi.output('html5rocks.com', function (err) { console.log('done'); }); API psi(url, [options], callback) url Required Type: string URL of the page for which the PageSpeed Insights API should generate results. options Type: object key
  • 2. Type: string Default: Free tier When using this module for a production-level build process, registering for an API key from theGoogle Developer Console is recommended. strategy Type: string Default: mobile Values: mobile, desktop Strategy to use when analyzing the page. locale Type: string Default: en_US Locale results should be generated in. threshold Type: number Default: 70 Threshold score to pass the PageSpeed test. callback(error, data) Required Type: function data Type: object The response from Google PageSpeed Insights. psi.output(url, [options], [callback]) Output the formatted report to the terminal. url and options is the same as psi().
  • 3. callback(error) Type: function Install CLI $ npm install --global psi $ psi --help Usage psi <url> <options> Example psi todomvc.com --strategy=mobile Options --key Google API Key. By default the free tier is used. --strategy Strategy to use when analyzing the page: mobile|desktop --format Output format: cli|json|tap --locale Locale results should be generated in. --threshold Threshold score to pass the PageSpeed test. Install grunt-pagespeed npm install grunt-pagespeed --save-dev Loading the plugin Add this to your project's Gruntfile.js gruntfile: grunt.loadNpmTasks('grunt-pagespeed'); Or, add this to your project's Gruntfile.coffee gruntfile: grunt.loadNpmTasks 'grunt-pagespeed' Alternatively use load-grunt-tasks to load your plugins. require('load-grunt-tasks')(grunt); Pagespeed task Run this task with the grunt pagespeed command.
  • 4. This task is a multi task so any targets, files and options should be specified according to the multi taskdocumentation. Usage Example pagespeed: { options: { nokey: true, url: "https://developers.google.com" }, prod: { options: { url: "https://developers.google.com/speed/docs/insights/v1/getting_started", locale: "en_GB", strategy: "desktop", threshold: 80 } }, paths: { options: { paths: ["/speed/docs/insights/v1/getting_started", "/speed/docs/about"], locale: "en_GB", strategy: "desktop", threshold: 80 } } } Options nokey Type: Boolean Use the nokey option to test-drive PageSpeed Insights before acquiring a key for production builds. key Type: String Google API Key url Type: String
  • 5. The URL of the page for which the PageSpeed Insights API should generate results. Target Properties url Type: String The URL of the page for which the PageSpeed Insights API should generate results. locale Type: String The locale that results should be generated in. This is mandatory. strategy Type: String The strategy to use when analyzing the page. Valid values are desktop and mobile. threshold Type: Number Threshold score that is needed to pass the pagespeed test paths Type: Array An array of URL paths that are appended to the URL Sample output The grunt task outputs the results as follows if everything passes:
  • 6. If the task fails to pass the threshold, then it ouputs something similar to the image below: