SlideShare a Scribd company logo
1 of 61
Improving Drupal’s page loading performance

Wim Leers ~ http://wimleers.com/

Drupal.org, IRC, Twitter, LinkedIn: wimleers
Overview
Overview

• Reasons

  • Why does it matter?

  • What is it?

  • Why is it important to Drupal?
Overview

• Reasons

  • Why does it matter?

  • What is it?

  • Why is it important to Drupal?

• Toolbox

  • Cuzillion

  • Hammerhead

  • YSlow

  • Jiffy
Overview

• Reasons                            • Drupal + YSlow

  • Why does it matter?                • The Good

  • What is it?                        • The Easy Fixes

  • Why is it important to Drupal?     • The Hard Problems

• Toolbox

  • Cuzillion

  • Hammerhead

  • YSlow

  • Jiffy
Overview

• Reasons                            • Drupal + YSlow

  • Why does it matter?                • The Good

  • What is it?                        • The Easy Fixes

  • Why is it important to Drupal?     • The Hard Problems

• Toolbox                            • Other optimizations

  • Cuzillion

  • Hammerhead

  • YSlow

  • Jiffy
Overview

• Reasons                            • Drupal + YSlow

  • Why does it matter?                • The Good

  • What is it?                        • The Easy Fixes

  • Why is it important to Drupal?     • The Hard Problems

• Toolbox                            • Other optimizations

  • Cuzillion                        • Bachelor thesis

  • Hammerhead                         • JS at the bottom

  • YSlow                              • CDN integration

  • Jiffy
Overview

• Reasons                            • Drupal + YSlow

  • Why does it matter?                • The Good

  • What is it?                        • The Easy Fixes

  • Why is it important to Drupal?     • The Hard Problems

• Toolbox                            • Other optimizations

  • Cuzillion                        • Bachelor thesis

  • Hammerhead                         • JS at the bottom

  • YSlow                              • CDN integration

  • Jiffy                            • Questions?
Why does it matter?

• Users care about performance!

     • Amazon: 100 ms of extra load time caused a 1% drop in sales

     • Google: 500 ms of extra load time caused 20% fewer searches

• Fast web sites are rewarded, slow web sites are punished




source: http://www.slideshare.net/stubbornella/designing-fast-websites-presentation
What is it?

• End user response time                  HTML   Components


   • 10-20%: the HTML document
     (mix of back-end + front-end)
                                          90%
   • 80-90%: the components in the page
     (front-end only)


• More effective to focus on front-end
                                                    10%
  performance!




 source: http://stevesouders.com/hpws/
Terminology: page loading performance




 page loading or front-end performance: the time it takes to
 load a web page and all its components (CSS, JS, images …)

 includes

 page rendering or back-end performance: the time the server
 needs to render a web page
Why is it important to Drupal?
Why is it important to Drupal?

• The Drupal Experience: happier users (and developers)
Why is it important to Drupal?

• The Drupal Experience: happier users (and developers)

• Drupal’s numbers

  • Big, high-traffic web sites


  • Popular (>125,000 sites): optimization affects many sites
Why is it important to Drupal?

• The Drupal Experience: happier users (and developers)

• Drupal’s numbers

   • Big, high-traffic web sites


   • Popular (>125,000 sites): optimization affects many sites


• Drupal is international (thanks to i18n/L10n)

   • International audiences: high network latencies


   • Developing countries: low-speed connections
Toolbox

1. Cuzillion: for understanding browser behavior better (learning)
Toolbox

1. Cuzillion: for understanding browser behavior better (learning)

2. Hammerhead: while developing (basic profiling/awareness)
Toolbox

1. Cuzillion: for understanding browser behavior better (learning)

2. Hammerhead: while developing (basic profiling/awareness)

3. YSlow: while improving page loading performance (detailed profiling)
Toolbox

1. Cuzillion: for understanding browser behavior better (learning)

2. Hammerhead: while developing (basic profiling/awareness)

3. YSlow: while improving page loading performance (detailed profiling)

4. Jiffy: for measuring real-world page loading performance (big scale profiling)
Toolbox: 1. Cuzillion

 Tool for quickly constructing web pages to see how components interact
Toolbox: 2. Hammerhead

• Firebug extension


• Makes it easier to stay aware of page loading performance while developing
Toolbox: 3. YSlow

 Checks how well a page implements 14 basic rules (actually 34)
Toolbox: 4. Jiffy

• Raison d’être: 3rd-party    • Jiffy, on the other hand:
  performance monitoring
  systems (Gomez, Keynote):


  • Limited number of            • Can measure every page load if desired
    measurement points
                                 • Runs in the browser: it’s JS code

                                    • Real-world browsers
  • No real-world browsers
    used
                                    • Can measure anything

  • Paid
                                 • Open source!

                              Jiffy.mark("slow3PStart");
                              jQuery.getScript(‘http://slowsite.com/slow.js’);
                              Jiffy.measure("slow3PDone", "slow3PStart");
Terminology: CDN




 A content delivery network (CDN) is a collection of web servers distributed
 across multiple locations to deliver content more efficiently to users. The server
 selected for delivering content to a specific user is typically based on a
 measure of network proximity.




source: http://developer.yahoo.com/performance/rules.html#cdn
Drupal + YSlow: things to keep in mind
Drupal + YSlow: things to keep in mind

• YSlow score does not necessarily reflect real-world performance, e.g.:


  • Using a CDN, but a slow or non-global one
Drupal + YSlow: things to keep in mind

• YSlow score does not necessarily reflect real-world performance, e.g.:


   • Using a CDN, but a slow or non-global one


• Striving to a perfect YSlow score is good


   • Especially in Drupal core: affects many sites and developers


   • But don’t forget to check real-world performance!
Drupal + YSlow: The Good

• Conform to YSlow rules through:
Drupal + YSlow: The Good

• Conform to YSlow rules through:


  • Doing nothing :)
Drupal + YSlow: The Good

• Conform to YSlow rules through:


  • Doing nothing :)


  • Very simple Drupal core configuration changes
Drupal + YSlow: The Good

• Rule 1: Make fewer HTTP requests




• Remarks

  • Problem: “dumb bundling” of CSS/JS files (see later)

• How to enable?

  • Enable at admin/settings/performance
Default   CSS aggregation   CSS/JS aggregation
Drupal + YSlow: The Good

• Rule 3: Add an Expires header




• Rule 4: Gzip components




• Rule 5: Put CSS at the top
Drupal + YSlow: The Good

• Rule 6: Put JS at the bottom




• Rule 7: Avoid CSS expressions




• Rule 8: Make JS and CSS external
Drupal + YSlow: The Good

• Rule 9: Reduce DNS lookups




• Remarks

  • External JS (e.g. Google Analytics) should be cached on your server

• How to enable?

  • Proper setting in Google Analytics module

  • Hacking other modules?
Drupal + YSlow: The Good

• Rule 11: Avoid Redirects




• Rule 12: Remove Duplicate Scripts
Drupal + YSlow: The Easy Fixes

• Conform to YSlow rules through:
Drupal + YSlow: The Easy Fixes

• Conform to YSlow rules through:


  • Modules
Drupal + YSlow: The Easy Fixes

• Conform to YSlow rules through:


  • Modules


  • Drupal core/module configuration
Drupal + YSlow: The Easy Fixes

• Conform to YSlow rules through:


  • Modules


  • Drupal core/module configuration


  • Web server configuration
Drupal + YSlow: The Easy Fixes

• Rule 1: Make fewer HTTP requests




• How to fix?

  • Intelligent bundling of CSS/JS files: Support file Cache module (Drupal 5
    only)
Drupal + YSlow: The Easy Fixes

• Rule 4: Gzip components




• How to fix?

  • Apache 2: edit your .htacces/httpd.conf
    AddOutputFilterByType DEFLATE text/css application/x-javascript


  • Use a CDN

  • Drupal 7: core patch?
Drupal + YSlow: The Easy Fixes

• Rule 10: Minify JavaScript




• Remarks

  • Use JSMIN, not Packer!

• How to fix?

  • Javascript Aggregator module (Drupal 5 & 6)
Drupal + YSlow: The Hard Problems
Drupal + YSlow: The Hard Problems

• Rule 2: Use a CDN




• The Tricky Thing

   • Far future Expires headers are more effective, but require unique filenames

• How to fix?

   • Drupal core patch: file_url()

   • CDN integration module
Drupal + YSlow: The Hard Problems

• Rule 6: Put JS at the bottom




• The Tricky Thing

   • JS that affects the style of a web page cannot be at the bottom

• How to fix?

   • Manual hacks :(

   • Drupal core patch necessary to change default location (see later)
Drupal + YSlow: The Hard Problems

• Rule 14: Make AJAX Cacheable




• Remarks

  • Possible today, but structured approach would be better

• How to fix?

  • Drupal 7 will support multiple rendering formats!

  • Gzip-ability should be a follow-up patch
Drupal + YSlow: recap

• Many things are already good out-of-the-box

• Easy fixes

  • Intelligent bundling of CSS/JS

  • Gzipping components

  • JS minification

• Hard problems

  • Using a CDN

  • Putting JS at the bottom

  • Make AJAX cacheable
Other optimizations

• Image optimization! (PNG-8, PNG instead of GIF, progressive JPEG …)


• Prefetching (part of the HTML5 specification)
  <link rel="prefetch" href="/images/big.jpeg">



• The 20 new rules (post- and pre-load components, flush the buffer early …)


•…
Bachelor thesis

 I’ll solve 2 of the 3 hard problems: CDN integration and JS at the bottom.



 Hasselt University has allowed me to work in an open source fashion and all of
 my work will therefor be available for everybody. Thanks!

 My promotor will be Prof. dr. Wim Lamotte and I will be guided by Stijn Agten
 and Maarten Wijnants.
Bachelor thesis: JS at the bottom

• Not enough work/too easy for an entire bachelor thesis


• Will be a core patch


• Change the default location to “footer”


• Clear guidelines on how to separate “style JS” from “non-style JS”
Bachelor thesis: CDN integration

• Plenty of work for a bachelor thesis

• 3 parts

   1. Daemon for synchronization, written in Python (back-end)

   2. Drupal core patch to unify generation of file URLs and allow to alter them

   3. Drupal module for administration and reporting (front-end)
Bachelor thesis: CDN integration

• Daemon goals

  • Ability to use any CDN transparently (FTP, rsync, Amazon S3 …)

  • Ability to mix CDNs and static file servers

  • Post-processing: image optimization, CSS/JS compression … transcoding?

  • Detect files instantly through file system event monitor (inotify on Linux)

• Other use cases: backup system, automatically sharing files within LAN …
Bachelor thesis: collaborating companies

 The following Drupal companies       The following CDN companies
 will be evaluating my work and       will be providing their services
 giving feedback.                     for free for testing purposes.




                                   A big thanks
                                  to all of them!
Questions?


 Relevant links:


  • This presentation – along with relevant links – can be found online at
    http://wimleers.com/talk/fosdem-2009

  • You can track my bachelor thesis’ progress at
    http://wimleers.com/tags/bachelor-thesis

  • Questions & feedback are welcome! Contact me via
    http://wimleers.com/contact

More Related Content

What's hot

When Devs Do Ops
When Devs Do OpsWhen Devs Do Ops
When Devs Do OpsWooga
 
HTML5 and CSS3: does now really mean now?
HTML5 and CSS3: does now really mean now?HTML5 and CSS3: does now really mean now?
HTML5 and CSS3: does now really mean now?Chris Mills
 
Joomla Day Chicago 2015 State of the Joomla! Union
Joomla Day Chicago 2015   State of the Joomla! UnionJoomla Day Chicago 2015   State of the Joomla! Union
Joomla Day Chicago 2015 State of the Joomla! UnionRod Martin
 
BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12ucbdrupal
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)François Massart
 
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012Rigor
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesMark Roden
 
Deliverance - a compelling way to theme Plone sites
Deliverance - a compelling way to theme Plone sitesDeliverance - a compelling way to theme Plone sites
Deliverance - a compelling way to theme Plone sitesJazkarta, Inc.
 
Modern javascript
Modern javascriptModern javascript
Modern javascriptKevin Ball
 
Drupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityDrupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityAshok Modi
 
Drupal, Taiwan - CMS 3.0
Drupal, Taiwan - CMS 3.0Drupal, Taiwan - CMS 3.0
Drupal, Taiwan - CMS 3.0Charles Chuang
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Getting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationGetting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationMelanie Archer
 
Swedisch Joomla!Day 3 November 2007
Swedisch Joomla!Day 3 November 2007Swedisch Joomla!Day 3 November 2007
Swedisch Joomla!Day 3 November 2007Wilco Jansen
 

What's hot (20)

When Devs Do Ops
When Devs Do OpsWhen Devs Do Ops
When Devs Do Ops
 
HTML5 and CSS3: does now really mean now?
HTML5 and CSS3: does now really mean now?HTML5 and CSS3: does now really mean now?
HTML5 and CSS3: does now really mean now?
 
Joomla Day Chicago 2015 State of the Joomla! Union
Joomla Day Chicago 2015   State of the Joomla! UnionJoomla Day Chicago 2015   State of the Joomla! Union
Joomla Day Chicago 2015 State of the Joomla! Union
 
BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
 
HTML5, are we there yet?
HTML5, are we there yet?HTML5, are we there yet?
HTML5, are we there yet?
 
Deliverance - a compelling way to theme Plone sites
Deliverance - a compelling way to theme Plone sitesDeliverance - a compelling way to theme Plone sites
Deliverance - a compelling way to theme Plone sites
 
Old Dog, New Tricks
Old Dog, New TricksOld Dog, New Tricks
Old Dog, New Tricks
 
Project management
Project managementProject management
Project management
 
Modern javascript
Modern javascriptModern javascript
Modern javascript
 
Drupal
DrupalDrupal
Drupal
 
Drupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityDrupal Frontend Performance and Scalability
Drupal Frontend Performance and Scalability
 
Big Websites
Big WebsitesBig Websites
Big Websites
 
Drupal, Taiwan - CMS 3.0
Drupal, Taiwan - CMS 3.0Drupal, Taiwan - CMS 3.0
Drupal, Taiwan - CMS 3.0
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Getting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationGetting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundation
 
Swedisch Joomla!Day 3 November 2007
Swedisch Joomla!Day 3 November 2007Swedisch Joomla!Day 3 November 2007
Swedisch Joomla!Day 3 November 2007
 

Similar to Fosdem 2009 – improving drupal's page loading performance

Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuningJohn McCaffrey
 
Getting started with dev tools (4/10/17 DC)
Getting started with dev tools (4/10/17 DC)Getting started with dev tools (4/10/17 DC)
Getting started with dev tools (4/10/17 DC)Daniel Friedman
 
DrupalCon Austin - Absolute Beginner's Guide to Drupal
DrupalCon Austin - Absolute Beginner's Guide to DrupalDrupalCon Austin - Absolute Beginner's Guide to Drupal
DrupalCon Austin - Absolute Beginner's Guide to DrupalRod Martin
 
My Site is slow - Drupal Camp London 2013
My Site is slow - Drupal Camp London 2013My Site is slow - Drupal Camp London 2013
My Site is slow - Drupal Camp London 2013hernanibf
 
How Not to Be Conned by Your Drupal Vendor!
How Not to Be Conned by Your Drupal Vendor!How Not to Be Conned by Your Drupal Vendor!
How Not to Be Conned by Your Drupal Vendor!pixelonion
 
Windycityrails page performance
Windycityrails page performanceWindycityrails page performance
Windycityrails page performanceJohn McCaffrey
 
Squeeze Maximum Performance From Your Joomla Website
Squeeze Maximum Performance From Your Joomla WebsiteSqueeze Maximum Performance From Your Joomla Website
Squeeze Maximum Performance From Your Joomla WebsiteSiteGround.com
 
What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012
What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012
What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012WordCamp Sydney
 
Upgrading to Drupal 7
Upgrading to Drupal 7Upgrading to Drupal 7
Upgrading to Drupal 7DesignHammer
 
Performance - When, What and How
Performance - When, What and HowPerformance - When, What and How
Performance - When, What and HowAstrails
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedAlexander Makarov
 
Promoting your organisation online with drupal
Promoting your organisation online with drupalPromoting your organisation online with drupal
Promoting your organisation online with drupalTroodon
 
Getting started with dev tools (05 09-17, santa monica) upload
Getting started with dev tools (05 09-17, santa monica) uploadGetting started with dev tools (05 09-17, santa monica) upload
Getting started with dev tools (05 09-17, santa monica) uploadThinkful
 
Velocity NY 2013 - From Slow to Fast: Improving Performance on Intuit Website...
Velocity NY 2013 - From Slow to Fast: Improving Performance on Intuit Website...Velocity NY 2013 - From Slow to Fast: Improving Performance on Intuit Website...
Velocity NY 2013 - From Slow to Fast: Improving Performance on Intuit Website...Jay Hung
 
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJSSrijan Technologies
 
Getting started with dev tools (atl)
Getting started with dev tools (atl)Getting started with dev tools (atl)
Getting started with dev tools (atl)Thinkful
 

Similar to Fosdem 2009 – improving drupal's page loading performance (20)

Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
Getting started with dev tools (4/10/17 DC)
Getting started with dev tools (4/10/17 DC)Getting started with dev tools (4/10/17 DC)
Getting started with dev tools (4/10/17 DC)
 
DrupalCon Austin - Absolute Beginner's Guide to Drupal
DrupalCon Austin - Absolute Beginner's Guide to DrupalDrupalCon Austin - Absolute Beginner's Guide to Drupal
DrupalCon Austin - Absolute Beginner's Guide to Drupal
 
My Site is slow - Drupal Camp London 2013
My Site is slow - Drupal Camp London 2013My Site is slow - Drupal Camp London 2013
My Site is slow - Drupal Camp London 2013
 
How Not to Be Conned by Your Drupal Vendor!
How Not to Be Conned by Your Drupal Vendor!How Not to Be Conned by Your Drupal Vendor!
How Not to Be Conned by Your Drupal Vendor!
 
Windycityrails page performance
Windycityrails page performanceWindycityrails page performance
Windycityrails page performance
 
Squeeze Maximum Performance From Your Joomla Website
Squeeze Maximum Performance From Your Joomla WebsiteSqueeze Maximum Performance From Your Joomla Website
Squeeze Maximum Performance From Your Joomla Website
 
What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012
What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012
What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012
 
Upgrading to Drupal 7
Upgrading to Drupal 7Upgrading to Drupal 7
Upgrading to Drupal 7
 
Performance - When, What and How
Performance - When, What and HowPerformance - When, What and How
Performance - When, What and How
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
 
Promoting your organisation online with drupal
Promoting your organisation online with drupalPromoting your organisation online with drupal
Promoting your organisation online with drupal
 
Drupal intro
Drupal introDrupal intro
Drupal intro
 
Drupal intro
Drupal introDrupal intro
Drupal intro
 
Getting started with dev tools (05 09-17, santa monica) upload
Getting started with dev tools (05 09-17, santa monica) uploadGetting started with dev tools (05 09-17, santa monica) upload
Getting started with dev tools (05 09-17, santa monica) upload
 
Drupal -Introduction to Drupal
Drupal -Introduction to DrupalDrupal -Introduction to Drupal
Drupal -Introduction to Drupal
 
Velocity NY 2013 - From Slow to Fast: Improving Performance on Intuit Website...
Velocity NY 2013 - From Slow to Fast: Improving Performance on Intuit Website...Velocity NY 2013 - From Slow to Fast: Improving Performance on Intuit Website...
Velocity NY 2013 - From Slow to Fast: Improving Performance on Intuit Website...
 
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
 
Getting started with dev tools (atl)
Getting started with dev tools (atl)Getting started with dev tools (atl)
Getting started with dev tools (atl)
 
Migrate all the things!
Migrate all the things!Migrate all the things!
Migrate all the things!
 

Recently uploaded

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Fosdem 2009 – improving drupal's page loading performance

  • 1. Improving Drupal’s page loading performance Wim Leers ~ http://wimleers.com/ Drupal.org, IRC, Twitter, LinkedIn: wimleers
  • 3. Overview • Reasons • Why does it matter? • What is it? • Why is it important to Drupal?
  • 4. Overview • Reasons • Why does it matter? • What is it? • Why is it important to Drupal? • Toolbox • Cuzillion • Hammerhead • YSlow • Jiffy
  • 5. Overview • Reasons • Drupal + YSlow • Why does it matter? • The Good • What is it? • The Easy Fixes • Why is it important to Drupal? • The Hard Problems • Toolbox • Cuzillion • Hammerhead • YSlow • Jiffy
  • 6. Overview • Reasons • Drupal + YSlow • Why does it matter? • The Good • What is it? • The Easy Fixes • Why is it important to Drupal? • The Hard Problems • Toolbox • Other optimizations • Cuzillion • Hammerhead • YSlow • Jiffy
  • 7. Overview • Reasons • Drupal + YSlow • Why does it matter? • The Good • What is it? • The Easy Fixes • Why is it important to Drupal? • The Hard Problems • Toolbox • Other optimizations • Cuzillion • Bachelor thesis • Hammerhead • JS at the bottom • YSlow • CDN integration • Jiffy
  • 8. Overview • Reasons • Drupal + YSlow • Why does it matter? • The Good • What is it? • The Easy Fixes • Why is it important to Drupal? • The Hard Problems • Toolbox • Other optimizations • Cuzillion • Bachelor thesis • Hammerhead • JS at the bottom • YSlow • CDN integration • Jiffy • Questions?
  • 9. Why does it matter? • Users care about performance! • Amazon: 100 ms of extra load time caused a 1% drop in sales • Google: 500 ms of extra load time caused 20% fewer searches • Fast web sites are rewarded, slow web sites are punished source: http://www.slideshare.net/stubbornella/designing-fast-websites-presentation
  • 10. What is it? • End user response time HTML Components • 10-20%: the HTML document (mix of back-end + front-end) 90% • 80-90%: the components in the page (front-end only) • More effective to focus on front-end 10% performance! source: http://stevesouders.com/hpws/
  • 11. Terminology: page loading performance page loading or front-end performance: the time it takes to load a web page and all its components (CSS, JS, images …) includes page rendering or back-end performance: the time the server needs to render a web page
  • 12. Why is it important to Drupal?
  • 13. Why is it important to Drupal? • The Drupal Experience: happier users (and developers)
  • 14. Why is it important to Drupal? • The Drupal Experience: happier users (and developers) • Drupal’s numbers • Big, high-traffic web sites • Popular (>125,000 sites): optimization affects many sites
  • 15. Why is it important to Drupal? • The Drupal Experience: happier users (and developers) • Drupal’s numbers • Big, high-traffic web sites • Popular (>125,000 sites): optimization affects many sites • Drupal is international (thanks to i18n/L10n) • International audiences: high network latencies • Developing countries: low-speed connections
  • 16. Toolbox 1. Cuzillion: for understanding browser behavior better (learning)
  • 17. Toolbox 1. Cuzillion: for understanding browser behavior better (learning) 2. Hammerhead: while developing (basic profiling/awareness)
  • 18. Toolbox 1. Cuzillion: for understanding browser behavior better (learning) 2. Hammerhead: while developing (basic profiling/awareness) 3. YSlow: while improving page loading performance (detailed profiling)
  • 19. Toolbox 1. Cuzillion: for understanding browser behavior better (learning) 2. Hammerhead: while developing (basic profiling/awareness) 3. YSlow: while improving page loading performance (detailed profiling) 4. Jiffy: for measuring real-world page loading performance (big scale profiling)
  • 20. Toolbox: 1. Cuzillion Tool for quickly constructing web pages to see how components interact
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. Toolbox: 2. Hammerhead • Firebug extension • Makes it easier to stay aware of page loading performance while developing
  • 26. Toolbox: 3. YSlow Checks how well a page implements 14 basic rules (actually 34)
  • 27. Toolbox: 4. Jiffy • Raison d’être: 3rd-party • Jiffy, on the other hand: performance monitoring systems (Gomez, Keynote): • Limited number of • Can measure every page load if desired measurement points • Runs in the browser: it’s JS code • Real-world browsers • No real-world browsers used • Can measure anything • Paid • Open source! Jiffy.mark("slow3PStart"); jQuery.getScript(‘http://slowsite.com/slow.js’); Jiffy.measure("slow3PDone", "slow3PStart");
  • 28. Terminology: CDN A content delivery network (CDN) is a collection of web servers distributed across multiple locations to deliver content more efficiently to users. The server selected for delivering content to a specific user is typically based on a measure of network proximity. source: http://developer.yahoo.com/performance/rules.html#cdn
  • 29. Drupal + YSlow: things to keep in mind
  • 30. Drupal + YSlow: things to keep in mind • YSlow score does not necessarily reflect real-world performance, e.g.: • Using a CDN, but a slow or non-global one
  • 31. Drupal + YSlow: things to keep in mind • YSlow score does not necessarily reflect real-world performance, e.g.: • Using a CDN, but a slow or non-global one • Striving to a perfect YSlow score is good • Especially in Drupal core: affects many sites and developers • But don’t forget to check real-world performance!
  • 32. Drupal + YSlow: The Good • Conform to YSlow rules through:
  • 33. Drupal + YSlow: The Good • Conform to YSlow rules through: • Doing nothing :)
  • 34. Drupal + YSlow: The Good • Conform to YSlow rules through: • Doing nothing :) • Very simple Drupal core configuration changes
  • 35. Drupal + YSlow: The Good • Rule 1: Make fewer HTTP requests • Remarks • Problem: “dumb bundling” of CSS/JS files (see later) • How to enable? • Enable at admin/settings/performance
  • 36.
  • 37. Default CSS aggregation CSS/JS aggregation
  • 38. Drupal + YSlow: The Good • Rule 3: Add an Expires header • Rule 4: Gzip components • Rule 5: Put CSS at the top
  • 39. Drupal + YSlow: The Good • Rule 6: Put JS at the bottom • Rule 7: Avoid CSS expressions • Rule 8: Make JS and CSS external
  • 40. Drupal + YSlow: The Good • Rule 9: Reduce DNS lookups • Remarks • External JS (e.g. Google Analytics) should be cached on your server • How to enable? • Proper setting in Google Analytics module • Hacking other modules?
  • 41.
  • 42. Drupal + YSlow: The Good • Rule 11: Avoid Redirects • Rule 12: Remove Duplicate Scripts
  • 43. Drupal + YSlow: The Easy Fixes • Conform to YSlow rules through:
  • 44. Drupal + YSlow: The Easy Fixes • Conform to YSlow rules through: • Modules
  • 45. Drupal + YSlow: The Easy Fixes • Conform to YSlow rules through: • Modules • Drupal core/module configuration
  • 46. Drupal + YSlow: The Easy Fixes • Conform to YSlow rules through: • Modules • Drupal core/module configuration • Web server configuration
  • 47. Drupal + YSlow: The Easy Fixes • Rule 1: Make fewer HTTP requests • How to fix? • Intelligent bundling of CSS/JS files: Support file Cache module (Drupal 5 only)
  • 48. Drupal + YSlow: The Easy Fixes • Rule 4: Gzip components • How to fix? • Apache 2: edit your .htacces/httpd.conf AddOutputFilterByType DEFLATE text/css application/x-javascript • Use a CDN • Drupal 7: core patch?
  • 49. Drupal + YSlow: The Easy Fixes • Rule 10: Minify JavaScript • Remarks • Use JSMIN, not Packer! • How to fix? • Javascript Aggregator module (Drupal 5 & 6)
  • 50. Drupal + YSlow: The Hard Problems
  • 51. Drupal + YSlow: The Hard Problems • Rule 2: Use a CDN • The Tricky Thing • Far future Expires headers are more effective, but require unique filenames • How to fix? • Drupal core patch: file_url() • CDN integration module
  • 52. Drupal + YSlow: The Hard Problems • Rule 6: Put JS at the bottom • The Tricky Thing • JS that affects the style of a web page cannot be at the bottom • How to fix? • Manual hacks :( • Drupal core patch necessary to change default location (see later)
  • 53. Drupal + YSlow: The Hard Problems • Rule 14: Make AJAX Cacheable • Remarks • Possible today, but structured approach would be better • How to fix? • Drupal 7 will support multiple rendering formats! • Gzip-ability should be a follow-up patch
  • 54. Drupal + YSlow: recap • Many things are already good out-of-the-box • Easy fixes • Intelligent bundling of CSS/JS • Gzipping components • JS minification • Hard problems • Using a CDN • Putting JS at the bottom • Make AJAX cacheable
  • 55. Other optimizations • Image optimization! (PNG-8, PNG instead of GIF, progressive JPEG …) • Prefetching (part of the HTML5 specification) <link rel="prefetch" href="/images/big.jpeg"> • The 20 new rules (post- and pre-load components, flush the buffer early …) •…
  • 56. Bachelor thesis I’ll solve 2 of the 3 hard problems: CDN integration and JS at the bottom. Hasselt University has allowed me to work in an open source fashion and all of my work will therefor be available for everybody. Thanks! My promotor will be Prof. dr. Wim Lamotte and I will be guided by Stijn Agten and Maarten Wijnants.
  • 57. Bachelor thesis: JS at the bottom • Not enough work/too easy for an entire bachelor thesis • Will be a core patch • Change the default location to “footer” • Clear guidelines on how to separate “style JS” from “non-style JS”
  • 58. Bachelor thesis: CDN integration • Plenty of work for a bachelor thesis • 3 parts 1. Daemon for synchronization, written in Python (back-end) 2. Drupal core patch to unify generation of file URLs and allow to alter them 3. Drupal module for administration and reporting (front-end)
  • 59. Bachelor thesis: CDN integration • Daemon goals • Ability to use any CDN transparently (FTP, rsync, Amazon S3 …) • Ability to mix CDNs and static file servers • Post-processing: image optimization, CSS/JS compression … transcoding? • Detect files instantly through file system event monitor (inotify on Linux) • Other use cases: backup system, automatically sharing files within LAN …
  • 60. Bachelor thesis: collaborating companies The following Drupal companies The following CDN companies will be evaluating my work and will be providing their services giving feedback. for free for testing purposes. A big thanks to all of them!
  • 61. Questions? Relevant links: • This presentation – along with relevant links – can be found online at http://wimleers.com/talk/fosdem-2009 • You can track my bachelor thesis’ progress at http://wimleers.com/tags/bachelor-thesis • Questions & feedback are welcome! Contact me via http://wimleers.com/contact

Editor's Notes

  1. Student at Hasselt University Freelance Drupal developer Intern at Mollom
  2. Popularity numbers: d.o usage statistics Conclusion: important for: - Drupal project growth - More Happy People
  3. Popularity numbers: d.o usage statistics Conclusion: important for: - Drupal project growth - More Happy People
  4. Popularity numbers: d.o usage statistics Conclusion: important for: - Drupal project growth - More Happy People
  5. Create a simple test: the effect of an inline script between 2 images in different browsers. Webkit: executes script, then displays images Firefox: displays first image, executes script, displays second image
  6. Notice how both images finish loading at the same time.
  7. Notice how the second image finishes loading about 2 seconds after the first one.
  8. I&amp;#x2019;ll only cover the 14 that were first published
  9. - Apache logs =&gt; database (script on cron) =&gt; reports - Mark (start timing) &amp; measure (measure elapsed time) approach - June 2008
  10. - dumb bundling reduces the effectiveness of aggregation
  11. script downloading? -&gt; no other downloads are started, not even from other domain names == blocks parallel downloads
  12. - Packer: * typically higher compression ratio, but: * adds a decompression delay on every page load!
  13. script downloading? -&gt; no other downloads are started, not even from other domain names == blocks parallel downloads