SlideShare ist ein Scribd-Unternehmen logo
1 von 61
Improving Drupal’s page loading performance

     Wim Leers ~ http://wimleers.com/

     Drupal.org, IRC, Twitter, LinkedIn: wimleers




Sunday, February 8, 2009
Overview




Sunday, February 8, 2009
Overview

     • Reasons

         • Why does it matter?

         • What is it?

         • Why is it important to Drupal?




Sunday, February 8, 2009
Overview

     • Reasons

         • Why does it matter?

         • What is it?

         • Why is it important to Drupal?

     • Toolbox

         • Cuzillion

         • Hammerhead

         • YSlow

         • Jiffy



Sunday, February 8, 2009
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



Sunday, February 8, 2009
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



Sunday, February 8, 2009
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



Sunday, February 8, 2009
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?



Sunday, February 8, 2009
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

Sunday, February 8, 2009
What is it?

                                                HTML   Components
     • End user response time


         • 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/

Sunday, February 8, 2009
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




Sunday, February 8, 2009
Why is it important to Drupal?




Sunday, February 8, 2009
Why is it important to Drupal?

     • The Drupal Experience: happier users (and developers)




Sunday, February 8, 2009
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




Sunday, February 8, 2009
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




Sunday, February 8, 2009
Toolbox

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




Sunday, February 8, 2009
Toolbox

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

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




Sunday, February 8, 2009
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)




Sunday, February 8, 2009
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)




Sunday, February 8, 2009
Toolbox: 1. Cuzillion

        Tool for quickly constructing web pages to see how components interact




Sunday, February 8, 2009
Sunday, February 8, 2009
Sunday, February 8, 2009
Sunday, February 8, 2009
Sunday, February 8, 2009
Toolbox: 2. Hammerhead

     • Firebug extension


     • Makes it easier to stay aware of page loading performance while developing




Sunday, February 8, 2009
Toolbox: 3. YSlow

        Checks how well a page implements 14 basic rules (actually 34)




Sunday, February 8, 2009
Toolbox: 4. Jiffy

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

                                       • Can measure every page load if desired
         • Limited number of
           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(quot;slow3PStartquot;);
                                    jQuery.getScript(‘http://slowsite.com/slow.js’);
                                    Jiffy.measure(quot;slow3PDonequot;, quot;slow3PStartquot;);


Sunday, February 8, 2009
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

Sunday, February 8, 2009
Drupal + YSlow: things to keep in mind




Sunday, February 8, 2009
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




Sunday, February 8, 2009
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!




Sunday, February 8, 2009
Drupal + YSlow: The Good

     • Conform to YSlow rules through:




Sunday, February 8, 2009
Drupal + YSlow: The Good

     • Conform to YSlow rules through:


         • Doing nothing :)




Sunday, February 8, 2009
Drupal + YSlow: The Good

     • Conform to YSlow rules through:


         • Doing nothing :)


         • Very simple Drupal core configuration changes




Sunday, February 8, 2009
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




Sunday, February 8, 2009
Sunday, February 8, 2009
Default   CSS aggregation   CSS/JS aggregation




Sunday, February 8, 2009
Drupal + YSlow: The Good

     • Rule 3: Add an Expires header




     • Rule 4: Gzip components




     • Rule 5: Put CSS at the top




Sunday, February 8, 2009
Drupal + YSlow: The Good

     • Rule 6: Put JS at the bottom




     • Rule 7: Avoid CSS expressions




     • Rule 8: Make JS and CSS external




Sunday, February 8, 2009
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?




Sunday, February 8, 2009
Sunday, February 8, 2009
Drupal + YSlow: The Good

     • Rule 11: Avoid Redirects




     • Rule 12: Remove Duplicate Scripts




Sunday, February 8, 2009
Drupal + YSlow: The Easy Fixes

     • Conform to YSlow rules through:




Sunday, February 8, 2009
Drupal + YSlow: The Easy Fixes

     • Conform to YSlow rules through:


         • Modules




Sunday, February 8, 2009
Drupal + YSlow: The Easy Fixes

     • Conform to YSlow rules through:


         • Modules


         • Drupal core/module configuration




Sunday, February 8, 2009
Drupal + YSlow: The Easy Fixes

     • Conform to YSlow rules through:


         • Modules


         • Drupal core/module configuration


         • Web server configuration




Sunday, February 8, 2009
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)




Sunday, February 8, 2009
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?




Sunday, February 8, 2009
Drupal + YSlow: The Easy Fixes

     • Rule 10: Minify JavaScript




     • Remarks

         • Use JSMIN, not Packer!

     • How to fix?

         • Javascript Aggregator module (Drupal 5 & 6)




Sunday, February 8, 2009
Drupal + YSlow: The Hard Problems




Sunday, February 8, 2009
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




Sunday, February 8, 2009
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)




Sunday, February 8, 2009
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




Sunday, February 8, 2009
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

Sunday, February 8, 2009
Other optimizations

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


     • Prefetching (part of the HTML5 specification)
        <link rel=quot;prefetchquot; href=quot;/images/big.jpegquot;>



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


     •…




Sunday, February 8, 2009
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.




Sunday, February 8, 2009
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”




Sunday, February 8, 2009
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)




Sunday, February 8, 2009
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 …




Sunday, February 8, 2009
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!

Sunday, February 8, 2009
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




Sunday, February 8, 2009

Weitere ähnliche Inhalte

Was ist angesagt?

Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)Adam Dunford
 
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Katie Sylor-Miller
 
Front End Optimization [Cloud Connect 2012]
Front End Optimization [Cloud Connect 2012]Front End Optimization [Cloud Connect 2012]
Front End Optimization [Cloud Connect 2012]Strangeloop
 
High Performance Mobile Web
High Performance Mobile WebHigh Performance Mobile Web
High Performance Mobile WebMorgan Cheng
 
Drupalcamp performance
Drupalcamp performanceDrupalcamp performance
Drupalcamp performanceFrontkom
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
PrairieDevCon 2014 -  Web Doesn't Mean SlowPrairieDevCon 2014 -  Web Doesn't Mean Slow
PrairieDevCon 2014 - Web Doesn't Mean Slowdmethvin
 
Static site gen talk
Static site gen talkStatic site gen talk
Static site gen talkBen Adam
 

Was ist angesagt? (7)

Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
 
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
 
Front End Optimization [Cloud Connect 2012]
Front End Optimization [Cloud Connect 2012]Front End Optimization [Cloud Connect 2012]
Front End Optimization [Cloud Connect 2012]
 
High Performance Mobile Web
High Performance Mobile WebHigh Performance Mobile Web
High Performance Mobile Web
 
Drupalcamp performance
Drupalcamp performanceDrupalcamp performance
Drupalcamp performance
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
PrairieDevCon 2014 -  Web Doesn't Mean SlowPrairieDevCon 2014 -  Web Doesn't Mean Slow
PrairieDevCon 2014 - Web Doesn't Mean Slow
 
Static site gen talk
Static site gen talkStatic site gen talk
Static site gen talk
 

Andere mochten auch

16 reasons why your website is loading slow
16 reasons why your website is loading slow16 reasons why your website is loading slow
16 reasons why your website is loading slowAcodez IT Solutions
 
More than 30_mb123
More than 30_mb123More than 30_mb123
More than 30_mb123livesite
 
Ppt With Speaker Notes
Ppt With Speaker NotesPpt With Speaker Notes
Ppt With Speaker Noteslivesite
 
Animations
AnimationsAnimations
Animationslivesite
 
Pptx With Speaker Notes
Pptx With Speaker NotesPptx With Speaker Notes
Pptx With Speaker Noteslivesite
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 

Andere mochten auch (8)

16 reasons why your website is loading slow
16 reasons why your website is loading slow16 reasons why your website is loading slow
16 reasons why your website is loading slow
 
More than 30_mb123
More than 30_mb123More than 30_mb123
More than 30_mb123
 
Banner1
Banner1Banner1
Banner1
 
Ppt With Speaker Notes
Ppt With Speaker NotesPpt With Speaker Notes
Ppt With Speaker Notes
 
Animations
AnimationsAnimations
Animations
 
Pptx With Speaker Notes
Pptx With Speaker NotesPptx With Speaker Notes
Pptx With Speaker Notes
 
Metrics of Joy
Metrics of JoyMetrics of Joy
Metrics of Joy
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Ähnlich wie Improve Drupal Page Speed With YSlow Rules

Fosdem 2009 – improving drupal's page loading performance
Fosdem 2009 – improving drupal's page loading performanceFosdem 2009 – improving drupal's page loading performance
Fosdem 2009 – improving drupal's page loading performanceErup Enolc
 
Working With People Adl Uni
Working With People Adl UniWorking With People Adl Uni
Working With People Adl UniMatthew Landauer
 
Administrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA HumAdministrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA HumAtlassian
 
Administrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA HumAdministrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA HumAtlassian
 
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)jjhuff
 
Performance as UX with Justin Howlett
Performance as UX with Justin HowlettPerformance as UX with Justin Howlett
Performance as UX with Justin HowlettFITC
 
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...Learnosity
 
[Workshop] Analyzing Your Deliverables: Developing the Optimal Documentation ...
[Workshop] Analyzing Your Deliverables: Developing the Optimal Documentation ...[Workshop] Analyzing Your Deliverables: Developing the Optimal Documentation ...
[Workshop] Analyzing Your Deliverables: Developing the Optimal Documentation ...Scott Abel
 
Analyzing Your Deliverables: Developing the Optimal Documentation Library
Analyzing Your Deliverables: Developing the Optimal Documentation LibraryAnalyzing Your Deliverables: Developing the Optimal Documentation Library
Analyzing Your Deliverables: Developing the Optimal Documentation LibraryScott Abel
 
Collaborating with the Community
Collaborating with the CommunityCollaborating with the Community
Collaborating with the Communitytinacallahan
 
Web Standards and Accessibility
Web Standards and AccessibilityWeb Standards and Accessibility
Web Standards and AccessibilityNick DeNardis
 
Google Analytics and Sungard HE Luminis
Google Analytics and Sungard HE LuminisGoogle Analytics and Sungard HE Luminis
Google Analytics and Sungard HE LuminisDavid Simpson
 
Just In Time Scalability Agile Methods To Support Massive Growth Presentation
Just In Time Scalability  Agile Methods To Support Massive Growth PresentationJust In Time Scalability  Agile Methods To Support Massive Growth Presentation
Just In Time Scalability Agile Methods To Support Massive Growth PresentationLong Nguyen
 
The 7 Sins of Software Engineers in HEP
The 7 Sins of Software Engineers in HEPThe 7 Sins of Software Engineers in HEP
The 7 Sins of Software Engineers in HEPIoannis Baltopoulos
 
Swedisch Joomla!Day 3 November 2007
Swedisch Joomla!Day 3 November 2007Swedisch Joomla!Day 3 November 2007
Swedisch Joomla!Day 3 November 2007Wilco Jansen
 
Deploying and Scaling using AWS
Deploying and Scaling using AWSDeploying and Scaling using AWS
Deploying and Scaling using AWSwr0ngway
 

Ähnlich wie Improve Drupal Page Speed With YSlow Rules (20)

Fosdem 2009 – improving drupal's page loading performance
Fosdem 2009 – improving drupal's page loading performanceFosdem 2009 – improving drupal's page loading performance
Fosdem 2009 – improving drupal's page loading performance
 
Working With People Adl Uni
Working With People Adl UniWorking With People Adl Uni
Working With People Adl Uni
 
Symfony for non-techies
Symfony for non-techiesSymfony for non-techies
Symfony for non-techies
 
Javascript Library
Javascript LibraryJavascript Library
Javascript Library
 
Drupal
DrupalDrupal
Drupal
 
Administrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA HumAdministrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA Hum
 
Administrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA HumAdministrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA Hum
 
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
 
Performance as UX with Justin Howlett
Performance as UX with Justin HowlettPerformance as UX with Justin Howlett
Performance as UX with Justin Howlett
 
Magee Dday2 Fixing App Performance Italiano
Magee Dday2 Fixing App Performance ItalianoMagee Dday2 Fixing App Performance Italiano
Magee Dday2 Fixing App Performance Italiano
 
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
 
[Workshop] Analyzing Your Deliverables: Developing the Optimal Documentation ...
[Workshop] Analyzing Your Deliverables: Developing the Optimal Documentation ...[Workshop] Analyzing Your Deliverables: Developing the Optimal Documentation ...
[Workshop] Analyzing Your Deliverables: Developing the Optimal Documentation ...
 
Analyzing Your Deliverables: Developing the Optimal Documentation Library
Analyzing Your Deliverables: Developing the Optimal Documentation LibraryAnalyzing Your Deliverables: Developing the Optimal Documentation Library
Analyzing Your Deliverables: Developing the Optimal Documentation Library
 
Collaborating with the Community
Collaborating with the CommunityCollaborating with the Community
Collaborating with the Community
 
Web Standards and Accessibility
Web Standards and AccessibilityWeb Standards and Accessibility
Web Standards and Accessibility
 
Google Analytics and Sungard HE Luminis
Google Analytics and Sungard HE LuminisGoogle Analytics and Sungard HE Luminis
Google Analytics and Sungard HE Luminis
 
Just In Time Scalability Agile Methods To Support Massive Growth Presentation
Just In Time Scalability  Agile Methods To Support Massive Growth PresentationJust In Time Scalability  Agile Methods To Support Massive Growth Presentation
Just In Time Scalability Agile Methods To Support Massive Growth Presentation
 
The 7 Sins of Software Engineers in HEP
The 7 Sins of Software Engineers in HEPThe 7 Sins of Software Engineers in HEP
The 7 Sins of Software Engineers in HEP
 
Swedisch Joomla!Day 3 November 2007
Swedisch Joomla!Day 3 November 2007Swedisch Joomla!Day 3 November 2007
Swedisch Joomla!Day 3 November 2007
 
Deploying and Scaling using AWS
Deploying and Scaling using AWSDeploying and Scaling using AWS
Deploying and Scaling using AWS
 

Kürzlich hochgeladen

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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
 
"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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
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
 

Kürzlich hochgeladen (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
"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...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
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
 

Improve Drupal Page Speed With YSlow Rules

  • 1. Improving Drupal’s page loading performance Wim Leers ~ http://wimleers.com/ Drupal.org, IRC, Twitter, LinkedIn: wimleers Sunday, February 8, 2009
  • 3. Overview • Reasons • Why does it matter? • What is it? • Why is it important to Drupal? Sunday, February 8, 2009
  • 4. Overview • Reasons • Why does it matter? • What is it? • Why is it important to Drupal? • Toolbox • Cuzillion • Hammerhead • YSlow • Jiffy Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 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? Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 10. What is it? HTML Components • End user response time • 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/ Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 12. Why is it important to Drupal? Sunday, February 8, 2009
  • 13. Why is it important to Drupal? • The Drupal Experience: happier users (and developers) Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 16. Toolbox 1. Cuzillion: for understanding browser behavior better (learning) Sunday, February 8, 2009
  • 17. Toolbox 1. Cuzillion: for understanding browser behavior better (learning) 2. Hammerhead: while developing (basic profiling/awareness) Sunday, February 8, 2009
  • 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) Sunday, February 8, 2009
  • 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) Sunday, February 8, 2009
  • 20. Toolbox: 1. Cuzillion Tool for quickly constructing web pages to see how components interact Sunday, February 8, 2009
  • 25. Toolbox: 2. Hammerhead • Firebug extension • Makes it easier to stay aware of page loading performance while developing Sunday, February 8, 2009
  • 26. Toolbox: 3. YSlow Checks how well a page implements 14 basic rules (actually 34) Sunday, February 8, 2009
  • 27. Toolbox: 4. Jiffy • Raison d’être: 3rd-party • Jiffy, on the other hand: performance monitoring systems (Gomez, Keynote): • Can measure every page load if desired • Limited number of 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(quot;slow3PStartquot;); jQuery.getScript(‘http://slowsite.com/slow.js’); Jiffy.measure(quot;slow3PDonequot;, quot;slow3PStartquot;); Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 29. Drupal + YSlow: things to keep in mind Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 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! Sunday, February 8, 2009
  • 32. Drupal + YSlow: The Good • Conform to YSlow rules through: Sunday, February 8, 2009
  • 33. Drupal + YSlow: The Good • Conform to YSlow rules through: • Doing nothing :) Sunday, February 8, 2009
  • 34. Drupal + YSlow: The Good • Conform to YSlow rules through: • Doing nothing :) • Very simple Drupal core configuration changes Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 37. Default CSS aggregation CSS/JS aggregation Sunday, February 8, 2009
  • 38. Drupal + YSlow: The Good • Rule 3: Add an Expires header • Rule 4: Gzip components • Rule 5: Put CSS at the top Sunday, February 8, 2009
  • 39. Drupal + YSlow: The Good • Rule 6: Put JS at the bottom • Rule 7: Avoid CSS expressions • Rule 8: Make JS and CSS external Sunday, February 8, 2009
  • 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? Sunday, February 8, 2009
  • 42. Drupal + YSlow: The Good • Rule 11: Avoid Redirects • Rule 12: Remove Duplicate Scripts Sunday, February 8, 2009
  • 43. Drupal + YSlow: The Easy Fixes • Conform to YSlow rules through: Sunday, February 8, 2009
  • 44. Drupal + YSlow: The Easy Fixes • Conform to YSlow rules through: • Modules Sunday, February 8, 2009
  • 45. Drupal + YSlow: The Easy Fixes • Conform to YSlow rules through: • Modules • Drupal core/module configuration Sunday, February 8, 2009
  • 46. Drupal + YSlow: The Easy Fixes • Conform to YSlow rules through: • Modules • Drupal core/module configuration • Web server configuration Sunday, February 8, 2009
  • 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) Sunday, February 8, 2009
  • 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? Sunday, February 8, 2009
  • 49. Drupal + YSlow: The Easy Fixes • Rule 10: Minify JavaScript • Remarks • Use JSMIN, not Packer! • How to fix? • Javascript Aggregator module (Drupal 5 & 6) Sunday, February 8, 2009
  • 50. Drupal + YSlow: The Hard Problems Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 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) Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009
  • 55. Other optimizations • Image optimization! (PNG-8, PNG instead of GIF, progressive JPEG …) • Prefetching (part of the HTML5 specification) <link rel=quot;prefetchquot; href=quot;/images/big.jpegquot;> • The 20 new rules (post- and pre-load components, flush the buffer early …) •… Sunday, February 8, 2009
  • 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. Sunday, February 8, 2009
  • 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” Sunday, February 8, 2009
  • 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) Sunday, February 8, 2009
  • 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 … Sunday, February 8, 2009
  • 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! Sunday, February 8, 2009
  • 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 Sunday, February 8, 2009

Hinweis der Redaktion

  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. 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
  4. Notice how both images finish loading at the same time.
  5. Notice how the second image finishes loading about 2 seconds after the first one.
  6. I&#x2019;ll only cover the 14 that were first published
  7. - Apache logs => database (script on cron) => reports - Mark (start timing) & measure (measure elapsed time) approach - June 2008
  8. - dumb bundling reduces the effectiveness of aggregation
  9. script downloading? -> no other downloads are started, not even from other domain names == blocks parallel downloads
  10. - Packer: * typically higher compression ratio, but: * adds a decompression delay on every page load!
  11. script downloading? -> no other downloads are started, not even from other domain names == blocks parallel downloads