SlideShare a Scribd company logo
1 of 44
Download to read offline
mattbailey.io
How I achieved a pretty
good Google PageSpeed
Insights Score
98/100* on both Mobile and Desktop
*On the home page at least…
The background
Built using Jekyll, a static site generator
No PHP, no database, just HTML, CSS and a tiny
bit of JavaScript
First of all, why bother when the site already
seemed pretty quick?
• It was a learning exercise for me
• I wanted to see how good a score I could get
• Plus, a certain amount of professional pride
was at stake
• Even if your site feels fast, it’s important to
resolve any underlying issues
• They are likely to become more and more
pronounced as a project scales up
• Google PageSpeed Insights highlighted a
number of problems
• And scored the site 68/100 for mobile, and
75/100 for desktop
:(
My Approach
Inline Critical CSS
CSS is a render-blocking resource
Inline critical CSS in the <head> to reduce
network request latency
The fewer HTTP requests the better
The goal - render ‘above-the-fold’ content in
one roundtrip to the server (~14kb)
Asynchronously loaded assets are not render-
blocking
Defer the remaining CSS using an async loader,
such as this one by Filament Group
https://github.com/filamentgroup/loadCSS
However, that means introducing a dependency
on some render-blocking JavaScript
If you load CSS asynchronously you will need to
deal with FOUC (Flash of Unstyled Content)
IMO keeping it simple is often best
Unless your CSS is rather large, just load it
normally - the browser will cache it
In my case my minified CSS was under 10KB*, so
I inlined the whole lot!
*10KB is the recommended maximum size for
inlined CSS
Use an async font loader
My site uses fonts from Typekit
Originally I had rather lazily used the standard
font loading script
<script src="https://use.typekit.net/vbu2ffi.js"></script>

<script>try{Typekit.load({ async: true });}catch(e){}</script>
However, Google does not like this
“Eliminate render-blocking Javascript and CSS
in above-the-fold content”
The solution?
Use an async font loading script
This means the browser can carry on rendering
the page without waiting for the fonts to load
What about FOUT (Flash of Unstyled Text)?
Typekit adds helper classes to the <html> tag
You can hook into them to initially hide, and
then show text once the fonts have loaded
.wf-loading

.wf-active
Remove render-blocking JavaScript
Google recommends:
If the script is small you can inline it to reduce
network request latency
Larger, external scripts should be loaded
asynchronously so as not to block DOM
construction
In my case the scripts used were small and non-
critical
So I inlined them at the bottom of the page
Minify HTML
You’ll have minimal gains in terms of bytes
saved, but it’s one more thing ticked off the list
It can be tricky to do, especially on dynamic
sites, but on simple, static sites it shouldn’t be a
problem
On my site I used a Ruby gem, called minify-
html - job done!
Enable Gzip compression on the server
Modern browsers can manage GZipped files on-
the-fly
Fewer bytes means faster downloads
Implementation
Configure mod_deflate in your .htaccess file
The h5bp project .htaccess file has a ‘Web
Performance’ section you can copy and paste
In summary
• Inline critical CSS, defer the rest (or not)
• Use an async font loader
• Remove render-blocking JavaScript
• Minify HTML
• Enable Gzip compression on the server
The result…
Having done all that I managed a score of
98/100 on both mobile and desktop!
:)
Why not 100/100?
“Leverage browser caching”
Unfortunately I have no control over external
resources and their cache headers:
http://use.typekit.net/vbu2ffi.js

http://www.google-analytics.com/ga.js
But I can live with that
What are your own
experiences with web
performance and SilverStripe?

More Related Content

What's hot

Tools for HTML5
Tools for HTML5Tools for HTML5
Tools for HTML5lillianabe
 
Html5 aavaas gajurel techmela
Html5  aavaas gajurel techmelaHtml5  aavaas gajurel techmela
Html5 aavaas gajurel techmelaAavaas Gajurel
 
Speed up Your Joomla Site for Ultimate Performance
Speed up Your Joomla Site for Ultimate PerformanceSpeed up Your Joomla Site for Ultimate Performance
Speed up Your Joomla Site for Ultimate PerformanceJoomlaDay Australia
 
More efficient, usable web
More efficient, usable webMore efficient, usable web
More efficient, usable webChris Mills
 
Optimizing your WordPress website
Optimizing your WordPress websiteOptimizing your WordPress website
Optimizing your WordPress websitemwfordesigns
 
Blazor - An Introduction
Blazor - An IntroductionBlazor - An Introduction
Blazor - An IntroductionJamieTaylor112
 
Introduction to WordPress Security
Introduction to WordPress SecurityIntroduction to WordPress Security
Introduction to WordPress SecurityNile Flores
 
Scaling woo commerce-v2-pagely
Scaling woo commerce-v2-pagelyScaling woo commerce-v2-pagely
Scaling woo commerce-v2-pagelyJoshua Eichorn
 
Site Speed Hacks: Open West 2015
Site Speed Hacks: Open West 2015Site Speed Hacks: Open West 2015
Site Speed Hacks: Open West 2015Dustin Nay
 
Angular and SEO - Greenlane All Hands Day 10/17/16
Angular and SEO - Greenlane All Hands Day 10/17/16Angular and SEO - Greenlane All Hands Day 10/17/16
Angular and SEO - Greenlane All Hands Day 10/17/16Sean Malseed
 
Web performance optimization for modern web applications
Web performance optimization for modern web applicationsWeb performance optimization for modern web applications
Web performance optimization for modern web applicationsChris Love
 
Building Responsible Wordpress Sites
Building Responsible Wordpress SitesBuilding Responsible Wordpress Sites
Building Responsible Wordpress SitesBrian Goldstein
 
NodeSummit - MEAN Stack
NodeSummit - MEAN StackNodeSummit - MEAN Stack
NodeSummit - MEAN StackValeri Karpov
 
Modern web application devlopment workflow
Modern web application devlopment workflowModern web application devlopment workflow
Modern web application devlopment workflowHamdi Hmidi
 
Real World HTML5 + ASP.NET MVC - Lessons Learned
Real World HTML5 + ASP.NET MVC - Lessons LearnedReal World HTML5 + ASP.NET MVC - Lessons Learned
Real World HTML5 + ASP.NET MVC - Lessons LearnedZoltán Dávid
 
How to Speed Up Your Joomla Website
How to Speed Up Your Joomla WebsiteHow to Speed Up Your Joomla Website
How to Speed Up Your Joomla WebsiteSiteGround.com
 
How to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteHow to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteDaniel Kanchev
 
DrupalCon Barcelona 2015
DrupalCon Barcelona 2015DrupalCon Barcelona 2015
DrupalCon Barcelona 2015Daniel Kanchev
 

What's hot (20)

Tools for HTML5
Tools for HTML5Tools for HTML5
Tools for HTML5
 
Html5 aavaas gajurel techmela
Html5  aavaas gajurel techmelaHtml5  aavaas gajurel techmela
Html5 aavaas gajurel techmela
 
Speed up Your Joomla Site for Ultimate Performance
Speed up Your Joomla Site for Ultimate PerformanceSpeed up Your Joomla Site for Ultimate Performance
Speed up Your Joomla Site for Ultimate Performance
 
More efficient, usable web
More efficient, usable webMore efficient, usable web
More efficient, usable web
 
Optimizing your WordPress website
Optimizing your WordPress websiteOptimizing your WordPress website
Optimizing your WordPress website
 
Blazor - An Introduction
Blazor - An IntroductionBlazor - An Introduction
Blazor - An Introduction
 
Introduction to WordPress Security
Introduction to WordPress SecurityIntroduction to WordPress Security
Introduction to WordPress Security
 
Scaling woo commerce-v2-pagely
Scaling woo commerce-v2-pagelyScaling woo commerce-v2-pagely
Scaling woo commerce-v2-pagely
 
Site Speed Hacks: Open West 2015
Site Speed Hacks: Open West 2015Site Speed Hacks: Open West 2015
Site Speed Hacks: Open West 2015
 
Angular and SEO - Greenlane All Hands Day 10/17/16
Angular and SEO - Greenlane All Hands Day 10/17/16Angular and SEO - Greenlane All Hands Day 10/17/16
Angular and SEO - Greenlane All Hands Day 10/17/16
 
Web performance optimization for modern web applications
Web performance optimization for modern web applicationsWeb performance optimization for modern web applications
Web performance optimization for modern web applications
 
Html5 for beginners
Html5 for beginnersHtml5 for beginners
Html5 for beginners
 
Caching 101
Caching 101Caching 101
Caching 101
 
Building Responsible Wordpress Sites
Building Responsible Wordpress SitesBuilding Responsible Wordpress Sites
Building Responsible Wordpress Sites
 
NodeSummit - MEAN Stack
NodeSummit - MEAN StackNodeSummit - MEAN Stack
NodeSummit - MEAN Stack
 
Modern web application devlopment workflow
Modern web application devlopment workflowModern web application devlopment workflow
Modern web application devlopment workflow
 
Real World HTML5 + ASP.NET MVC - Lessons Learned
Real World HTML5 + ASP.NET MVC - Lessons LearnedReal World HTML5 + ASP.NET MVC - Lessons Learned
Real World HTML5 + ASP.NET MVC - Lessons Learned
 
How to Speed Up Your Joomla Website
How to Speed Up Your Joomla WebsiteHow to Speed Up Your Joomla Website
How to Speed Up Your Joomla Website
 
How to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteHow to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! Site
 
DrupalCon Barcelona 2015
DrupalCon Barcelona 2015DrupalCon Barcelona 2015
DrupalCon Barcelona 2015
 

Viewers also liked

Viewers also liked (8)

08 led-18 w-ceiling-sq-flush
08 led-18 w-ceiling-sq-flush08 led-18 w-ceiling-sq-flush
08 led-18 w-ceiling-sq-flush
 
Lindenwood Letter of Rec
Lindenwood Letter of RecLindenwood Letter of Rec
Lindenwood Letter of Rec
 
NOV 2016 Profile ABDUR RAHMAN
NOV 2016 Profile ABDUR RAHMANNOV 2016 Profile ABDUR RAHMAN
NOV 2016 Profile ABDUR RAHMAN
 
Ako správne osloviť dievča, ženu na pokec i m.m.
Ako správne osloviť dievča, ženu na pokec i m.m.Ako správne osloviť dievča, ženu na pokec i m.m.
Ako správne osloviť dievča, ženu na pokec i m.m.
 
Rifalni 10-11-16
Rifalni 10-11-16Rifalni 10-11-16
Rifalni 10-11-16
 
Выполняй правила безопасности на дороге!
Выполняй правила безопасности на дороге!Выполняй правила безопасности на дороге!
Выполняй правила безопасности на дороге!
 
Global Net Tech profile
Global Net Tech profileGlobal Net Tech profile
Global Net Tech profile
 
Media (16)
Media (16)Media (16)
Media (16)
 

Similar to How i acheived a pretty good google page speed insights score

Web Client Performance
Web Client PerformanceWeb Client Performance
Web Client PerformanceHerea Adrian
 
Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...Thomas Audunhus
 
Drupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityDrupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityAshok Modi
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsSiarhei Barysiuk
 
A Holistic View of Website Performance
A Holistic View of Website PerformanceA Holistic View of Website Performance
A Holistic View of Website PerformanceRene Churchill
 
Lazy load Website Assets
Lazy load Website AssetsLazy load Website Assets
Lazy load Website AssetsChris Love
 
Client Side Optimization
Client Side OptimizationClient Side Optimization
Client Side OptimizationPatrick Huesler
 
Demystifying web performance tooling and metrics
Demystifying web performance tooling and metricsDemystifying web performance tooling and metrics
Demystifying web performance tooling and metricsAnna Migas
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek editionChris Love
 
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersSearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersDistilled
 
Magento Performance Improvements with Client Side Optimizations
Magento Performance Improvements with Client Side OptimizationsMagento Performance Improvements with Client Side Optimizations
Magento Performance Improvements with Client Side OptimizationsPINT Inc
 
Optimizing Your WordPress Site: Why speed matters, and how to get there
Optimizing Your WordPress Site: Why speed matters, and how to get thereOptimizing Your WordPress Site: Why speed matters, and how to get there
Optimizing Your WordPress Site: Why speed matters, and how to get thereStephen Bell
 
Myths & true stories about JavaScript for SEO
Myths & true stories about JavaScript for SEOMyths & true stories about JavaScript for SEO
Myths & true stories about JavaScript for SEOSara Moccand-Sayegh
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...Otto Kekäläinen
 
Introduction to Optimizing WordPress for Website Speed
Introduction to Optimizing WordPress for Website SpeedIntroduction to Optimizing WordPress for Website Speed
Introduction to Optimizing WordPress for Website SpeedNile Flores
 
Website speed optimization guide for technically advanced webmasters
Website speed optimization guide for technically advanced webmastersWebsite speed optimization guide for technically advanced webmasters
Website speed optimization guide for technically advanced webmastersAditya Singh
 
Website Performance
Website PerformanceWebsite Performance
Website PerformanceHugo Fonseca
 
Minimize website page loading time – 20+ advanced SEO tips
Minimize website page loading time – 20+ advanced SEO tipsMinimize website page loading time – 20+ advanced SEO tips
Minimize website page loading time – 20+ advanced SEO tipsCgColors
 

Similar to How i acheived a pretty good google page speed insights score (20)

Web Client Performance
Web Client PerformanceWeb Client Performance
Web Client Performance
 
Speed!
Speed!Speed!
Speed!
 
Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...
 
Drupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityDrupal Frontend Performance and Scalability
Drupal Frontend Performance and Scalability
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
A Holistic View of Website Performance
A Holistic View of Website PerformanceA Holistic View of Website Performance
A Holistic View of Website Performance
 
Lazy load Website Assets
Lazy load Website AssetsLazy load Website Assets
Lazy load Website Assets
 
WordPress optimization
WordPress optimizationWordPress optimization
WordPress optimization
 
Client Side Optimization
Client Side OptimizationClient Side Optimization
Client Side Optimization
 
Demystifying web performance tooling and metrics
Demystifying web performance tooling and metricsDemystifying web performance tooling and metrics
Demystifying web performance tooling and metrics
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek edition
 
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersSearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
 
Magento Performance Improvements with Client Side Optimizations
Magento Performance Improvements with Client Side OptimizationsMagento Performance Improvements with Client Side Optimizations
Magento Performance Improvements with Client Side Optimizations
 
Optimizing Your WordPress Site: Why speed matters, and how to get there
Optimizing Your WordPress Site: Why speed matters, and how to get thereOptimizing Your WordPress Site: Why speed matters, and how to get there
Optimizing Your WordPress Site: Why speed matters, and how to get there
 
Myths & true stories about JavaScript for SEO
Myths & true stories about JavaScript for SEOMyths & true stories about JavaScript for SEO
Myths & true stories about JavaScript for SEO
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
 
Introduction to Optimizing WordPress for Website Speed
Introduction to Optimizing WordPress for Website SpeedIntroduction to Optimizing WordPress for Website Speed
Introduction to Optimizing WordPress for Website Speed
 
Website speed optimization guide for technically advanced webmasters
Website speed optimization guide for technically advanced webmastersWebsite speed optimization guide for technically advanced webmasters
Website speed optimization guide for technically advanced webmasters
 
Website Performance
Website PerformanceWebsite Performance
Website Performance
 
Minimize website page loading time – 20+ advanced SEO tips
Minimize website page loading time – 20+ advanced SEO tipsMinimize website page loading time – 20+ advanced SEO tips
Minimize website page loading time – 20+ advanced SEO tips
 

Recently uploaded

定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxeditsforyah
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationMarko4394
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleanscorenetworkseo
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 

Recently uploaded (20)

定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptx
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentation
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleans
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 

How i acheived a pretty good google page speed insights score

  • 2. How I achieved a pretty good Google PageSpeed Insights Score
  • 3. 98/100* on both Mobile and Desktop *On the home page at least…
  • 5.
  • 6. Built using Jekyll, a static site generator No PHP, no database, just HTML, CSS and a tiny bit of JavaScript
  • 7. First of all, why bother when the site already seemed pretty quick?
  • 8. • It was a learning exercise for me • I wanted to see how good a score I could get • Plus, a certain amount of professional pride was at stake
  • 9. • Even if your site feels fast, it’s important to resolve any underlying issues • They are likely to become more and more pronounced as a project scales up • Google PageSpeed Insights highlighted a number of problems • And scored the site 68/100 for mobile, and 75/100 for desktop
  • 10.
  • 11. :(
  • 14. CSS is a render-blocking resource Inline critical CSS in the <head> to reduce network request latency The fewer HTTP requests the better The goal - render ‘above-the-fold’ content in one roundtrip to the server (~14kb)
  • 15. Asynchronously loaded assets are not render- blocking Defer the remaining CSS using an async loader, such as this one by Filament Group https://github.com/filamentgroup/loadCSS
  • 16. However, that means introducing a dependency on some render-blocking JavaScript If you load CSS asynchronously you will need to deal with FOUC (Flash of Unstyled Content)
  • 17. IMO keeping it simple is often best Unless your CSS is rather large, just load it normally - the browser will cache it
  • 18. In my case my minified CSS was under 10KB*, so I inlined the whole lot! *10KB is the recommended maximum size for inlined CSS
  • 19.
  • 20. Use an async font loader
  • 21. My site uses fonts from Typekit
  • 22. Originally I had rather lazily used the standard font loading script <script src="https://use.typekit.net/vbu2ffi.js"></script>
 <script>try{Typekit.load({ async: true });}catch(e){}</script>
  • 23. However, Google does not like this “Eliminate render-blocking Javascript and CSS in above-the-fold content”
  • 24. The solution? Use an async font loading script This means the browser can carry on rendering the page without waiting for the fonts to load
  • 25. What about FOUT (Flash of Unstyled Text)? Typekit adds helper classes to the <html> tag You can hook into them to initially hide, and then show text once the fonts have loaded .wf-loading
 .wf-active
  • 27. Google recommends: If the script is small you can inline it to reduce network request latency Larger, external scripts should be loaded asynchronously so as not to block DOM construction
  • 28. In my case the scripts used were small and non- critical So I inlined them at the bottom of the page
  • 29.
  • 31. You’ll have minimal gains in terms of bytes saved, but it’s one more thing ticked off the list It can be tricky to do, especially on dynamic sites, but on simple, static sites it shouldn’t be a problem On my site I used a Ruby gem, called minify- html - job done!
  • 32. Enable Gzip compression on the server
  • 33. Modern browsers can manage GZipped files on- the-fly Fewer bytes means faster downloads
  • 34. Implementation Configure mod_deflate in your .htaccess file The h5bp project .htaccess file has a ‘Web Performance’ section you can copy and paste
  • 35.
  • 37. • Inline critical CSS, defer the rest (or not) • Use an async font loader • Remove render-blocking JavaScript • Minify HTML • Enable Gzip compression on the server
  • 39. Having done all that I managed a score of 98/100 on both mobile and desktop!
  • 40. :)
  • 41.
  • 42. Why not 100/100? “Leverage browser caching” Unfortunately I have no control over external resources and their cache headers: http://use.typekit.net/vbu2ffi.js
 http://www.google-analytics.com/ga.js
  • 43. But I can live with that
  • 44. What are your own experiences with web performance and SilverStripe?