SlideShare ist ein Scribd-Unternehmen logo
1 von 70
Downloaden Sie, um offline zu lesen
Friday, May 4, 2012
This Slide Is Blank




Friday, May 4, 2012
Friday, May 4, 2012
joseph@josephscott.org
                 http://josephscott.org/
                      @josephscott




Friday, May 4, 2012
Improving
   Front-End
   Performance

Friday, May 4, 2012
Improve the
            Perceived
            Responsiveness
            of a Site


Friday, May 4, 2012
The
            Measurements



Friday, May 4, 2012
Chrome
            Network Panel




Friday, May 4, 2012
Chrome
            Page Speed




Friday, May 4, 2012
webpagetest.org




      http://www.webpagetest.org/result/120501_S5_45YNJ/
Friday, May 4, 2012
The Techniques




Friday, May 4, 2012
HTTP Compression




Friday, May 4, 2012
HTTP Compression

      Request:
                      Accept-Encoding: deflate, gzip


      Response:
                      Content-Encoding: gzip




Friday, May 4, 2012
HTTP Compression
      HTTP/1.1 200 OK
      Expires: Sun, 26 Dec 2032 06:12:01 GMT
      Vary: Accept-Encoding
      Content-Encoding: gzip
      Last-Modified: Wed, 25 Apr 2012 15:27:45 GMT
      ETag: "2942247273"
      Content-Type: text/css
      Accept-Ranges: bytes
      Content-Length: 43524
      Date: Fri, 27 Apr 2012 02:09:28 GMT
      Server: lighttpd-yt/1.4.18
      Age: 227872
      Cache-Control: public, max-age=31104000


                                          youtube.com CSS Request




Friday, May 4, 2012
HTTP Compression



      Response:
                      Vary: Accept-Encoding




Friday, May 4, 2012
HTTP Keep Alive




Friday, May 4, 2012
HTTP Keep Alive

      Request:
                      Connection: keep-alive


      Response:
                      Connection: keep-alive




Friday, May 4, 2012
HTTP Caching




Friday, May 4, 2012
HTTP Caching
    Response:

    Expires: Fri, 05 May 2017 01:06:01 GMT




Friday, May 4, 2012
HTTP Caching
    Response:

    Cache-Control: max-age: 31536000




Friday, May 4, 2012
HTTP Caching
      Response:
                Last-Modified: Tue, 12 Dec 2006 03:03:59 GMT




      Request:
      If-Modified-Since: Tue, 12 Dec 2006 03:03:59 GMT




Friday, May 4, 2012
HTTP Caching
      Response:
                Etag: "850d9-d2ff-4b881f248ec80"



      Request:
                If-None-Match: "850d9-d2ff-4b881f248ec80"




Friday, May 4, 2012
HTTP Caching

      Response:
                HTTP/1.1 200 OK

                HTTP/1.1 304 Not Modified




Friday, May 4, 2012
HTTP Caching



                      Etag, so misunderstood




Friday, May 4, 2012
HTTP Caching
               Updating Cached Resources




Friday, May 4, 2012
HTTP Caching

   http://example.com/css/style.css?v=1


   http://example.com/css/style.1.css




Friday, May 4, 2012
Avoid Redirects




Friday, May 4, 2012
Avoid Redirects

                      utah.gov




Friday, May 4, 2012
Avoid Redirects

                      utah.gov



                      utah.gov/index.html




Friday, May 4, 2012
Avoid Redirects

                      utah.gov

                                 120ms

                      utah.gov/index.html




Friday, May 4, 2012
Avoid Redirects

                      deseretnews.com




Friday, May 4, 2012
Avoid Redirects

                      deseretnews.com



          www.deseretnews.com/




Friday, May 4, 2012
Avoid Redirects

                      deseretnews.com



          www.deseretnews.com/


          www.deseretnews.com/home/


Friday, May 4, 2012
Avoid Redirects

                      deseretnews.com

                                   150ms

          www.deseretnews.com/
                                   150ms

          www.deseretnews.com/home/


Friday, May 4, 2012
CSS




Friday, May 4, 2012
CSS



                      Always at the top!




Friday, May 4, 2012
CSS



                      #IDs are only slightly
                      faster than .CLASSes




Friday, May 4, 2012
CSS
        #nav a

        Browsers read right to left




Friday, May 4, 2012
CSS
        Bad: #nav * { }

        Better: #nav a { }

        Betterest: #nav .now { }



Friday, May 4, 2012
CSS

        html body .wrapper #content a{}

                          VS.
                      #content a{}




Friday, May 4, 2012
CSS

        https://developer.mozilla.org/en/
        Writing_Efficient_CSS

        https://developers.google.com/
        speed/docs/best-practices/rendering




Friday, May 4, 2012
CSS



        Minify your CSS files




Friday, May 4, 2012
CSS



        Use CSS Sprites

                      http://spriteme.org/



Friday, May 4, 2012
Javascript




Friday, May 4, 2012
Javascript



                      Always at the
                      bottom!




Friday, May 4, 2012
Javascript
                      Bottom and Async!




Friday, May 4, 2012
Javascript
                        Bottom and Async!

                      (function() {
                         var js = document.createElement( 'script' );
                         js.async = true;
                         js.src = '/js/awesome.js’;

                         var s = document.getElementsByTagName( 'script' )[0];
                         s.parentNode.insertBefore( js, s );
                      } )();




Friday, May 4, 2012
Javascript
                        Bottom and Async!

                      (function() {
                         var js = document.createElement( 'script' );
                         js.async = true;
                         js.src = '/js/awesome.js’;

                         var s = document.getElementsByTagName( 'script' )[0];
                         s.parentNode.insertBefore( js, s );
                      } )();




Friday, May 4, 2012
Javascript
                        Bottom and Async!

                      (function() {
                         var js = document.createElement( 'script' );
                         js.async = true;
                         js.src = '/js/awesome.js’;

                         var s = document.getElementsByTagName( 'script' )[0];
                         s.parentNode.insertBefore( js, s );
                      } )();




Friday, May 4, 2012
Javascript
                        Bottom and Async!

                      (function() {
                         var js = document.createElement( 'script' );
                         js.async = true;
                         js.src = '/js/awesome.js’;

                         var s = document.getElementsByTagName( 'script' )[0];
                         s.parentNode.insertBefore( js, s );
                      } )();




Friday, May 4, 2012
Javascript



                      jQuery
                      Selector Performance




Friday, May 4, 2012
Javascript
              <div id="box">
                <p> Hi </p>
              </div>
                <script src="//ajax.googleapis.com/ajax/
              libs/jquery/1/jquery.min.js"></script>
              <script>
                var box = $('#box');
              </script>




Friday, May 4, 2012
Javascript


                      $('#box > p');
                      $('#box p');
                      $('#box').children('p');
                      $('p', $('#box'));
                      $('p', '#box');




Friday, May 4, 2012
Javascript


                      $('#box > p'); /* Horrible! */
                      $('#box p');      /* Horrible! */
                      $('#box').children('p');     /* Bad */
                      $('p', $('#box'));           /* Less Bad */
                      $('p', '#box');              /* Less Bad */




Friday, May 4, 2012
Javascript


                      box.find('p');

                      $('p', box);
                      $('#box').find('p');




Friday, May 4, 2012
Javascript


                      box.find('p');         /* Best! */

                      $('p', box);           /* Almost there! */
                      $('#box').find('p');   /* Better */




 http://jsperf.com/jquery-selector-perf-right-to-left/57


Friday, May 4, 2012
Javascript
                      box.find('p');


                      document.getElementById
                      ("box").getElementsByTagName("p");




Friday, May 4, 2012
Javascript
                      box.find('p');     /* 48k ops/sec */


                      document.getElementById
                      ("box").getElementsByTagName("p");
                      /* 2,000k ops/sec */




 http://jsperf.com/jquery-selector-perf-right-to-left/91


Friday, May 4, 2012
Javascript


                      Be careful with
                      event handlers




Friday, May 4, 2012
Javascript


                      Carefully minimize
                      your Javascript




Friday, May 4, 2012
Various Tips




Friday, May 4, 2012
Separate Domain
    For Static Resources

                      example.com

                          fakecdn.example.com

                      fakecdnexample.com




Friday, May 4, 2012
Optimize Images


                      pngcrush

                                    jpegtran


              http://www.smushit.com/ysmush.it/
                           http://imageoptim.com/


Friday, May 4, 2012
Delay Loading Resources

           <img
           data-gravatar_hash="713072bbe89035a79c17d19e53dd5d9b"
               class="load-gravatar" height="64" width="64"
               src="https://secure.gravatar.com/avatar/
           00000000000000000000000000000000?s=64&d=mm" />




           https://github.com/josephscott/async-gravatars




Friday, May 4, 2012
Have a favicon.ico


                      Small
                              Cacheable




Friday, May 4, 2012
Cacheable AJAX




                      Standard Rules Apply




Friday, May 4, 2012
Experiment with cuzillion




            http://stevesouders.com/cuzillion/




Friday, May 4, 2012
Experiment with
    Browserscope




                      http://www.browserscope.org/




Friday, May 4, 2012
Questions?




Friday, May 4, 2012
joseph@josephscott.org
                 http://josephscott.org/
                      @josephscott




Friday, May 4, 2012

Weitere ähnliche Inhalte

Was ist angesagt?

HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!Christian Heilmann
 
Progressive Downloads and Rendering - take #2
Progressive Downloads and Rendering - take #2Progressive Downloads and Rendering - take #2
Progressive Downloads and Rendering - take #2Stoyan Stefanov
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行Sofish Lin
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009Ralph Whitbeck
 
Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Aaron Gustafson
 
High Performance Social Plugins
High Performance Social PluginsHigh Performance Social Plugins
High Performance Social PluginsStoyan Stefanov
 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & FriendsRemy Sharp
 
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Nicholas Zakas
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5Sayed Ahmed
 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5Kevin DeRudder
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Terry Ryan
 
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJLeonardo Balter
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5Steven Chipman
 

Was ist angesagt? (17)

HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!
 
Progressive Downloads and Rendering - take #2
Progressive Downloads and Rendering - take #2Progressive Downloads and Rendering - take #2
Progressive Downloads and Rendering - take #2
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
Jquery tutorial
Jquery tutorialJquery tutorial
Jquery tutorial
 
Joomla Technical SEO
Joomla Technical SEOJoomla Technical SEO
Joomla Technical SEO
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
 
Shifting Gears
Shifting GearsShifting Gears
Shifting Gears
 
Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]
 
High Performance Social Plugins
High Performance Social PluginsHigh Performance Social Plugins
High Performance Social Plugins
 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & Friends
 
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5
 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 

Ähnlich wie Improving Front End Performance

Web Page Test - Beyond the Basics
Web Page Test - Beyond the BasicsWeb Page Test - Beyond the Basics
Web Page Test - Beyond the BasicsAndy Davies
 
Developing RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBDeveloping RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBNicola Iarocci
 
Optimización JavaScript y CSS
Optimización JavaScript y CSSOptimización JavaScript y CSS
Optimización JavaScript y CSSlucascepeda
 
Symfony2 and MongoDB
Symfony2 and MongoDBSymfony2 and MongoDB
Symfony2 and MongoDBPablo Godel
 
Como escalar aplicações PHP
Como escalar aplicações PHPComo escalar aplicações PHP
Como escalar aplicações PHPAugusto Pascutti
 
Análisis de ataques APT
Análisis de ataques APT Análisis de ataques APT
Análisis de ataques APT linenoise
 
Better front-end development in Atlassian plugins
Better front-end development in Atlassian pluginsBetter front-end development in Atlassian plugins
Better front-end development in Atlassian pluginsAtlassian
 
JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patternsStoyan Stefanov
 
Overview of Backbone
Overview of BackboneOverview of Backbone
Overview of BackboneJohn Ashmead
 
Games for the Masses - Wie DevOps die Entwicklung von Architektur verändert (...
Games for the Masses - Wie DevOps die Entwicklung von Architektur verändert (...Games for the Masses - Wie DevOps die Entwicklung von Architektur verändert (...
Games for the Masses - Wie DevOps die Entwicklung von Architektur verändert (...Wooga
 
MVC way to introduce Sails.js - node.js framework
MVC way to introduce Sails.js - node.js frameworkMVC way to introduce Sails.js - node.js framework
MVC way to introduce Sails.js - node.js frameworkCaesar Chi
 
Games for the Masses (QCon London 2012)
Games for the Masses (QCon London 2012)Games for the Masses (QCon London 2012)
Games for the Masses (QCon London 2012)Wooga
 
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
 
Doing Things the WordPress Way
Doing Things the WordPress WayDoing Things the WordPress Way
Doing Things the WordPress WayMatt Wiebe
 
JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance PatternsStoyan Stefanov
 
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013cordoval
 
SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014Mark Rackley
 

Ähnlich wie Improving Front End Performance (20)

Web Page Test - Beyond the Basics
Web Page Test - Beyond the BasicsWeb Page Test - Beyond the Basics
Web Page Test - Beyond the Basics
 
Developing RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBDeveloping RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDB
 
Optimización JavaScript y CSS
Optimización JavaScript y CSSOptimización JavaScript y CSS
Optimización JavaScript y CSS
 
Symfony2 and MongoDB
Symfony2 and MongoDBSymfony2 and MongoDB
Symfony2 and MongoDB
 
Como escalar aplicações PHP
Como escalar aplicações PHPComo escalar aplicações PHP
Como escalar aplicações PHP
 
Análisis de ataques APT
Análisis de ataques APT Análisis de ataques APT
Análisis de ataques APT
 
Learning sparql 2012 12
Learning sparql 2012 12Learning sparql 2012 12
Learning sparql 2012 12
 
Better front-end development in Atlassian plugins
Better front-end development in Atlassian pluginsBetter front-end development in Atlassian plugins
Better front-end development in Atlassian plugins
 
JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patterns
 
Spring J2EE
Spring J2EESpring J2EE
Spring J2EE
 
Overview of Backbone
Overview of BackboneOverview of Backbone
Overview of Backbone
 
Games for the Masses - Wie DevOps die Entwicklung von Architektur verändert (...
Games for the Masses - Wie DevOps die Entwicklung von Architektur verändert (...Games for the Masses - Wie DevOps die Entwicklung von Architektur verändert (...
Games for the Masses - Wie DevOps die Entwicklung von Architektur verändert (...
 
MVC way to introduce Sails.js - node.js framework
MVC way to introduce Sails.js - node.js frameworkMVC way to introduce Sails.js - node.js framework
MVC way to introduce Sails.js - node.js framework
 
Games for the Masses (QCon London 2012)
Games for the Masses (QCon London 2012)Games for the Masses (QCon London 2012)
Games for the Masses (QCon London 2012)
 
React mini lecture
React mini lectureReact mini lecture
React mini lecture
 
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?
 
Doing Things the WordPress Way
Doing Things the WordPress WayDoing Things the WordPress Way
Doing Things the WordPress Way
 
JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance Patterns
 
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
 
SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014
 

Mehr von Joseph Scott

Site Testing with CasperJS
Site Testing with CasperJSSite Testing with CasperJS
Site Testing with CasperJSJoseph Scott
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariJoseph Scott
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Joseph Scott
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & ScalabilityJoseph Scott
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & ScalabilityJoseph Scott
 

Mehr von Joseph Scott (9)

Scaling WordPress
Scaling WordPressScaling WordPress
Scaling WordPress
 
Site Testing with CasperJS
Site Testing with CasperJSSite Testing with CasperJS
Site Testing with CasperJS
 
Python & FUSE
Python & FUSEPython & FUSE
Python & FUSE
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & Scalability
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & Scalability
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 

Kürzlich hochgeladen

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
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
 
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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Kürzlich hochgeladen (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
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
 
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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
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...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
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!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

Improving Front End Performance

  • 2. This Slide Is Blank Friday, May 4, 2012
  • 4. joseph@josephscott.org http://josephscott.org/ @josephscott Friday, May 4, 2012
  • 5. Improving Front-End Performance Friday, May 4, 2012
  • 6. Improve the Perceived Responsiveness of a Site Friday, May 4, 2012
  • 7. The Measurements Friday, May 4, 2012
  • 8. Chrome Network Panel Friday, May 4, 2012
  • 9. Chrome Page Speed Friday, May 4, 2012
  • 10. webpagetest.org http://www.webpagetest.org/result/120501_S5_45YNJ/ Friday, May 4, 2012
  • 13. HTTP Compression Request: Accept-Encoding: deflate, gzip Response: Content-Encoding: gzip Friday, May 4, 2012
  • 14. HTTP Compression HTTP/1.1 200 OK Expires: Sun, 26 Dec 2032 06:12:01 GMT Vary: Accept-Encoding Content-Encoding: gzip Last-Modified: Wed, 25 Apr 2012 15:27:45 GMT ETag: "2942247273" Content-Type: text/css Accept-Ranges: bytes Content-Length: 43524 Date: Fri, 27 Apr 2012 02:09:28 GMT Server: lighttpd-yt/1.4.18 Age: 227872 Cache-Control: public, max-age=31104000 youtube.com CSS Request Friday, May 4, 2012
  • 15. HTTP Compression Response: Vary: Accept-Encoding Friday, May 4, 2012
  • 16. HTTP Keep Alive Friday, May 4, 2012
  • 17. HTTP Keep Alive Request: Connection: keep-alive Response: Connection: keep-alive Friday, May 4, 2012
  • 19. HTTP Caching Response: Expires: Fri, 05 May 2017 01:06:01 GMT Friday, May 4, 2012
  • 20. HTTP Caching Response: Cache-Control: max-age: 31536000 Friday, May 4, 2012
  • 21. HTTP Caching Response: Last-Modified: Tue, 12 Dec 2006 03:03:59 GMT Request: If-Modified-Since: Tue, 12 Dec 2006 03:03:59 GMT Friday, May 4, 2012
  • 22. HTTP Caching Response: Etag: "850d9-d2ff-4b881f248ec80" Request: If-None-Match: "850d9-d2ff-4b881f248ec80" Friday, May 4, 2012
  • 23. HTTP Caching Response: HTTP/1.1 200 OK HTTP/1.1 304 Not Modified Friday, May 4, 2012
  • 24. HTTP Caching Etag, so misunderstood Friday, May 4, 2012
  • 25. HTTP Caching Updating Cached Resources Friday, May 4, 2012
  • 26. HTTP Caching http://example.com/css/style.css?v=1 http://example.com/css/style.1.css Friday, May 4, 2012
  • 28. Avoid Redirects utah.gov Friday, May 4, 2012
  • 29. Avoid Redirects utah.gov utah.gov/index.html Friday, May 4, 2012
  • 30. Avoid Redirects utah.gov 120ms utah.gov/index.html Friday, May 4, 2012
  • 31. Avoid Redirects deseretnews.com Friday, May 4, 2012
  • 32. Avoid Redirects deseretnews.com www.deseretnews.com/ Friday, May 4, 2012
  • 33. Avoid Redirects deseretnews.com www.deseretnews.com/ www.deseretnews.com/home/ Friday, May 4, 2012
  • 34. Avoid Redirects deseretnews.com 150ms www.deseretnews.com/ 150ms www.deseretnews.com/home/ Friday, May 4, 2012
  • 36. CSS Always at the top! Friday, May 4, 2012
  • 37. CSS #IDs are only slightly faster than .CLASSes Friday, May 4, 2012
  • 38. CSS #nav a Browsers read right to left Friday, May 4, 2012
  • 39. CSS Bad: #nav * { } Better: #nav a { } Betterest: #nav .now { } Friday, May 4, 2012
  • 40. CSS html body .wrapper #content a{} VS. #content a{} Friday, May 4, 2012
  • 41. CSS https://developer.mozilla.org/en/ Writing_Efficient_CSS https://developers.google.com/ speed/docs/best-practices/rendering Friday, May 4, 2012
  • 42. CSS Minify your CSS files Friday, May 4, 2012
  • 43. CSS Use CSS Sprites http://spriteme.org/ Friday, May 4, 2012
  • 45. Javascript Always at the bottom! Friday, May 4, 2012
  • 46. Javascript Bottom and Async! Friday, May 4, 2012
  • 47. Javascript Bottom and Async! (function() { var js = document.createElement( 'script' ); js.async = true; js.src = '/js/awesome.js’; var s = document.getElementsByTagName( 'script' )[0]; s.parentNode.insertBefore( js, s ); } )(); Friday, May 4, 2012
  • 48. Javascript Bottom and Async! (function() { var js = document.createElement( 'script' ); js.async = true; js.src = '/js/awesome.js’; var s = document.getElementsByTagName( 'script' )[0]; s.parentNode.insertBefore( js, s ); } )(); Friday, May 4, 2012
  • 49. Javascript Bottom and Async! (function() { var js = document.createElement( 'script' ); js.async = true; js.src = '/js/awesome.js’; var s = document.getElementsByTagName( 'script' )[0]; s.parentNode.insertBefore( js, s ); } )(); Friday, May 4, 2012
  • 50. Javascript Bottom and Async! (function() { var js = document.createElement( 'script' ); js.async = true; js.src = '/js/awesome.js’; var s = document.getElementsByTagName( 'script' )[0]; s.parentNode.insertBefore( js, s ); } )(); Friday, May 4, 2012
  • 51. Javascript jQuery Selector Performance Friday, May 4, 2012
  • 52. Javascript <div id="box"> <p> Hi </p> </div> <script src="//ajax.googleapis.com/ajax/ libs/jquery/1/jquery.min.js"></script> <script> var box = $('#box'); </script> Friday, May 4, 2012
  • 53. Javascript $('#box > p'); $('#box p'); $('#box').children('p'); $('p', $('#box')); $('p', '#box'); Friday, May 4, 2012
  • 54. Javascript $('#box > p'); /* Horrible! */ $('#box p'); /* Horrible! */ $('#box').children('p'); /* Bad */ $('p', $('#box')); /* Less Bad */ $('p', '#box'); /* Less Bad */ Friday, May 4, 2012
  • 55. Javascript box.find('p'); $('p', box); $('#box').find('p'); Friday, May 4, 2012
  • 56. Javascript box.find('p'); /* Best! */ $('p', box); /* Almost there! */ $('#box').find('p'); /* Better */ http://jsperf.com/jquery-selector-perf-right-to-left/57 Friday, May 4, 2012
  • 57. Javascript box.find('p'); document.getElementById ("box").getElementsByTagName("p"); Friday, May 4, 2012
  • 58. Javascript box.find('p'); /* 48k ops/sec */ document.getElementById ("box").getElementsByTagName("p"); /* 2,000k ops/sec */ http://jsperf.com/jquery-selector-perf-right-to-left/91 Friday, May 4, 2012
  • 59. Javascript Be careful with event handlers Friday, May 4, 2012
  • 60. Javascript Carefully minimize your Javascript Friday, May 4, 2012
  • 62. Separate Domain For Static Resources example.com fakecdn.example.com fakecdnexample.com Friday, May 4, 2012
  • 63. Optimize Images pngcrush jpegtran http://www.smushit.com/ysmush.it/ http://imageoptim.com/ Friday, May 4, 2012
  • 64. Delay Loading Resources <img data-gravatar_hash="713072bbe89035a79c17d19e53dd5d9b" class="load-gravatar" height="64" width="64" src="https://secure.gravatar.com/avatar/ 00000000000000000000000000000000?s=64&d=mm" /> https://github.com/josephscott/async-gravatars Friday, May 4, 2012
  • 65. Have a favicon.ico Small Cacheable Friday, May 4, 2012
  • 66. Cacheable AJAX Standard Rules Apply Friday, May 4, 2012
  • 67. Experiment with cuzillion http://stevesouders.com/cuzillion/ Friday, May 4, 2012
  • 68. Experiment with Browserscope http://www.browserscope.org/ Friday, May 4, 2012
  • 70. joseph@josephscott.org http://josephscott.org/ @josephscott Friday, May 4, 2012