SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado (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
 

Similar a 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
 

Similar a 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
 

Último

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 

Último (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 

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: