SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
AIESEC IT School 2012




             Building faster websites
                      Front-end performance




Mihai Oaida<mihai.oaida@gmail.com>            1
About me

     Mihai Oaida
         Senior Web developer @imobiliare.ro
         Student M.S.E. Politehnica Timișoara
         http://www.slideshare.net/mihai.oaida




Mihai Oaida<mihai.oaida@gmail.com>                2
Agenda

     Web application architecture
     Web application performance
     Frontend performance
     The 14 rules
     Other tips
     Tools
     Conclusions


Mihai Oaida<mihai.oaida@gmail.com>   3
Web application architecture




Mihai Oaida<mihai.oaida@gmail.com>   4
Web application architecture




 http://www.webpagetest.org/

Mihai Oaida<mihai.oaida@gmail.com>   5
Web application performance

     How do you measure it ?
     How users react to it?
     Why is it important?




Mihai Oaida<mihai.oaida@gmail.com>   6
JavaScript

     Douglas Crockford on browsers:
           ”The most hostile software developement
      enviroment imaginable”
     Wrote "JavaScript the Good Parts"




Mihai Oaida<mihai.oaida@gmail.com>                   7
Frontend performance

     Time spent on the client side
     The client side model
     80-90% of the total time
     Factors
         Host machine
         Network bandwidth
         Network latency
         Number of web resources


Mihai Oaida<mihai.oaida@gmail.com>    8
The 14 rules

     Rule 1: Make fewer HTTP requests
         Use sprites for images
         Merge css files
         Merge js files
         Use multiple subdomains
                           img1.tehnologii-web.ro
                           img2.tehnologii-web.ro




Mihai Oaida<mihai.oaida@gmail.com>                   9
The 14 rules

     Rule 2: Use a CDN ( Content delivery network )
      or
         Use dedicated server(s) just for static
         Use asynchronous web servers: Lighthttpd, nginx
         Use cookie free domains
         TCP slow start
     Rule 3: Add an Expires Header
     Rule 4: Gzip Components


Mihai Oaida<mihai.oaida@gmail.com>                          10
The 14 rules

     Rule 5: Put Stylesheets at the Top
     Rule 6: Put Scripts at the Bottom
         Blocking scripts: document.write
         <script src="script.js">/script>




Mihai Oaida<mihai.oaida@gmail.com>           11
The 14 rules

     Rule 7: Avoid CSS Expressions
     Rule 8: Make JavaScript and CSS External
     Rule 9: Reduce DNS Lookups
     Rule 10: Minify JavaScript




Mihai Oaida<mihai.oaida@gmail.com>               12
The 14 rules

     Rule 11: Avoid Redirects
     Rule 12: Remove Duplicate Scripts
     Rule 13: Configure Etags
     Rule 14: Make Ajax Cacheable




Mihai Oaida<mihai.oaida@gmail.com>        13
Lazy loading

     scripts,Images,ads
     70-80% downloaded code is not executed
        immediately for payloads of 100-300K
     No blocking javascript
     Example: google image search




Mihai Oaida<mihai.oaida@gmail.com>             14
Lazy execution

     Execute js code faster than with eval()

 function sayHi(){
      scriptContent = 'alert("hi")';
      scriptElem = document.createElement('script');
      head = document.getElementByTagName('head')[0]
      head.appendChild(scriptElem);
      scriptElem.text = scriptContent
 }


Mihai Oaida<mihai.oaida@gmail.com>                     15
Lazy loading

     Dynamic load script after page load
 function loadScript(){
       scriptElem = document.createElement('script');
       scriptElem.src = "http://domain.com/script.js";
       head = document.getElementByTagName('head')[0]
       head.appendChild(scriptElem);
 }




Mihai Oaida<mihai.oaida@gmail.com>                       16
Profiling

     document end
         download rate
         parsing time
         inline javascript execution
     document load
         on load event - all resources loaded




Mihai Oaida<mihai.oaida@gmail.com>               17
Profiling - After <head>

 <script type="text/javascript">
     documentStart = new Date().getTime();
 </script>




Mihai Oaida<mihai.oaida@gmail.com>           18
Profiling - Before </body>

 <script type="text/javascript">
 documentEnd = new Date().getTime()-documentStart;

 jQuery(window).load(function(){

       callbackUrl ='http://www.foo.ro/timing';
       documentLoad = new Date().getTime()-documentStart;
         profileTokens = {
            'document_end':documentEnd,
            'document_load':documentLoad,
            'page' : window.location.href.split('.ro')[1]
         };




Mihai Oaida<mihai.oaida@gmail.com>                          19
Profiling - Before </body>

           i=0;
           for(k in profileTokens) {
              delim = (i==0?'?':'&');
              callbackUrl+= delim+k+'='+profileTokens[k];
              i++;
           };

         img = document.createElement('img');
         img.src = callbackUrl;
         document.body.appendChild(img);
       });

 </script>




Mihai Oaida<mihai.oaida@gmail.com>                          20
Tools

     Tools
         HttpWatch
         Wireshark
         Firebug
         Yslow
         Web developement Tools
         http://www.webpagetest.org/
         http://smush.it/
     Resources:
         http://stevesouders.com/hpws/

Mihai Oaida<mihai.oaida@gmail.com>        21
Conclusions

     Each rule has a different impact
     Rules are not all mandatory
     Measure first
     Measure after




Mihai Oaida<mihai.oaida@gmail.com>       22
Thank you!




Mihai Oaida<mihai.oaida@gmail.com>                23

Weitere ähnliche Inhalte

Was ist angesagt?

Building Better WordPress Sites
Building Better WordPress SitesBuilding Better WordPress Sites
Building Better WordPress SitesBrian LaFrance
 
Blazor certification training - Dot Net Tricks
Blazor certification training - Dot Net TricksBlazor certification training - Dot Net Tricks
Blazor certification training - Dot Net TricksGaurav Singh
 
Cloud Expo Europe 2014: Practical methods to improve your security in the cloud
Cloud Expo Europe 2014: Practical methods to improve your security in the cloudCloud Expo Europe 2014: Practical methods to improve your security in the cloud
Cloud Expo Europe 2014: Practical methods to improve your security in the cloudDatabarracks
 
Securing data and preventing data breaches
Securing data and preventing data breachesSecuring data and preventing data breaches
Securing data and preventing data breachesMariaDB plc
 
Semi Structured Data
Semi Structured DataSemi Structured Data
Semi Structured DataMariaDB plc
 
Building a Drupal-driven Intranet
Building a Drupal-driven IntranetBuilding a Drupal-driven Intranet
Building a Drupal-driven Intranetlibrarywebchic
 
Cloud computing
Cloud computingCloud computing
Cloud computinghwalice666
 
雲端運算 英文Ppt
雲端運算 英文Ppt雲端運算 英文Ppt
雲端運算 英文Ppthwalice666
 
Session 2 branding and site development in SharePoint
Session 2   branding and site development in SharePointSession 2   branding and site development in SharePoint
Session 2 branding and site development in SharePointKhoa Quach
 
Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016
Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016
Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016Niall Beard
 
Fast, Powerful and Scalable Analytics
Fast, Powerful and Scalable AnalyticsFast, Powerful and Scalable Analytics
Fast, Powerful and Scalable AnalyticsMariaDB plc
 
Working with Data in Service Workers
Working with Data in Service WorkersWorking with Data in Service Workers
Working with Data in Service WorkersGil Fink
 
AWS Summit Berlin 2013 - doo - A Scalable Sync Framework Infrastructure based...
AWS Summit Berlin 2013 - doo - A Scalable Sync Framework Infrastructure based...AWS Summit Berlin 2013 - doo - A Scalable Sync Framework Infrastructure based...
AWS Summit Berlin 2013 - doo - A Scalable Sync Framework Infrastructure based...AWS Germany
 
Dynamic to-static
Dynamic to-staticDynamic to-static
Dynamic to-staticbiilmann
 
CSF18 - External Collaboration with Azure B2B - Sjoukje Zaal
CSF18 - External Collaboration with Azure B2B - Sjoukje ZaalCSF18 - External Collaboration with Azure B2B - Sjoukje Zaal
CSF18 - External Collaboration with Azure B2B - Sjoukje ZaalNCCOMMS
 
Building a Database for the Future with MongoDB Atlas
Building a Database for the Future with MongoDB AtlasBuilding a Database for the Future with MongoDB Atlas
Building a Database for the Future with MongoDB AtlasAmazon Web Services
 

Was ist angesagt? (20)

Building Better WordPress Sites
Building Better WordPress SitesBuilding Better WordPress Sites
Building Better WordPress Sites
 
Blazor certification training - Dot Net Tricks
Blazor certification training - Dot Net TricksBlazor certification training - Dot Net Tricks
Blazor certification training - Dot Net Tricks
 
Ajax Presentation
Ajax PresentationAjax Presentation
Ajax Presentation
 
Cloud Expo Europe 2014: Practical methods to improve your security in the cloud
Cloud Expo Europe 2014: Practical methods to improve your security in the cloudCloud Expo Europe 2014: Practical methods to improve your security in the cloud
Cloud Expo Europe 2014: Practical methods to improve your security in the cloud
 
Securing data and preventing data breaches
Securing data and preventing data breachesSecuring data and preventing data breaches
Securing data and preventing data breaches
 
Semi Structured Data
Semi Structured DataSemi Structured Data
Semi Structured Data
 
Squeezing Web Performance
Squeezing Web PerformanceSqueezing Web Performance
Squeezing Web Performance
 
Building a Drupal-driven Intranet
Building a Drupal-driven IntranetBuilding a Drupal-driven Intranet
Building a Drupal-driven Intranet
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
雲端運算 英文Ppt
雲端運算 英文Ppt雲端運算 英文Ppt
雲端運算 英文Ppt
 
Session 2 branding and site development in SharePoint
Session 2   branding and site development in SharePointSession 2   branding and site development in SharePoint
Session 2 branding and site development in SharePoint
 
Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016
Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016
Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016
 
Fast, Powerful and Scalable Analytics
Fast, Powerful and Scalable AnalyticsFast, Powerful and Scalable Analytics
Fast, Powerful and Scalable Analytics
 
Working with Data in Service Workers
Working with Data in Service WorkersWorking with Data in Service Workers
Working with Data in Service Workers
 
Ajax
AjaxAjax
Ajax
 
AWS Summit Berlin 2013 - doo - A Scalable Sync Framework Infrastructure based...
AWS Summit Berlin 2013 - doo - A Scalable Sync Framework Infrastructure based...AWS Summit Berlin 2013 - doo - A Scalable Sync Framework Infrastructure based...
AWS Summit Berlin 2013 - doo - A Scalable Sync Framework Infrastructure based...
 
Dynamic to-static
Dynamic to-staticDynamic to-static
Dynamic to-static
 
CSF18 - External Collaboration with Azure B2B - Sjoukje Zaal
CSF18 - External Collaboration with Azure B2B - Sjoukje ZaalCSF18 - External Collaboration with Azure B2B - Sjoukje Zaal
CSF18 - External Collaboration with Azure B2B - Sjoukje Zaal
 
Building a Database for the Future with MongoDB Atlas
Building a Database for the Future with MongoDB AtlasBuilding a Database for the Future with MongoDB Atlas
Building a Database for the Future with MongoDB Atlas
 

Andere mochten auch

Notiuni avansate MySQL - Infoeducatie 2008
Notiuni avansate MySQL - Infoeducatie 2008Notiuni avansate MySQL - Infoeducatie 2008
Notiuni avansate MySQL - Infoeducatie 2008Mihai Oaida
 
jQuery - GeekMeet Timisoara
jQuery - GeekMeet TimisoarajQuery - GeekMeet Timisoara
jQuery - GeekMeet TimisoaraMihai Oaida
 
Arhitecturi de cacheing server side - LVLE 2009
Arhitecturi de cacheing server side - LVLE 2009Arhitecturi de cacheing server side - LVLE 2009
Arhitecturi de cacheing server side - LVLE 2009Mihai Oaida
 
Notiuni avansate MySQL - LVLE 2009
Notiuni avansate MySQL - LVLE 2009Notiuni avansate MySQL - LVLE 2009
Notiuni avansate MySQL - LVLE 2009Mihai Oaida
 
Teme - Proiectarea si normalizarea bazelor de date - Infoeducatie 2008
Teme - Proiectarea si normalizarea bazelor de date - Infoeducatie 2008Teme - Proiectarea si normalizarea bazelor de date - Infoeducatie 2008
Teme - Proiectarea si normalizarea bazelor de date - Infoeducatie 2008Mihai Oaida
 
Linux/Unix-based Operating Systems
Linux/Unix-based Operating SystemsLinux/Unix-based Operating Systems
Linux/Unix-based Operating SystemsMihai Oaida
 

Andere mochten auch (7)

K-Means
K-MeansK-Means
K-Means
 
Notiuni avansate MySQL - Infoeducatie 2008
Notiuni avansate MySQL - Infoeducatie 2008Notiuni avansate MySQL - Infoeducatie 2008
Notiuni avansate MySQL - Infoeducatie 2008
 
jQuery - GeekMeet Timisoara
jQuery - GeekMeet TimisoarajQuery - GeekMeet Timisoara
jQuery - GeekMeet Timisoara
 
Arhitecturi de cacheing server side - LVLE 2009
Arhitecturi de cacheing server side - LVLE 2009Arhitecturi de cacheing server side - LVLE 2009
Arhitecturi de cacheing server side - LVLE 2009
 
Notiuni avansate MySQL - LVLE 2009
Notiuni avansate MySQL - LVLE 2009Notiuni avansate MySQL - LVLE 2009
Notiuni avansate MySQL - LVLE 2009
 
Teme - Proiectarea si normalizarea bazelor de date - Infoeducatie 2008
Teme - Proiectarea si normalizarea bazelor de date - Infoeducatie 2008Teme - Proiectarea si normalizarea bazelor de date - Infoeducatie 2008
Teme - Proiectarea si normalizarea bazelor de date - Infoeducatie 2008
 
Linux/Unix-based Operating Systems
Linux/Unix-based Operating SystemsLinux/Unix-based Operating Systems
Linux/Unix-based Operating Systems
 

Ähnlich wie Building faster websites Front-end performance

Polymer
Polymer Polymer
Polymer jskvara
 
A brave new web - A talk about Web Components
A brave new web - A talk about Web ComponentsA brave new web - A talk about Web Components
A brave new web - A talk about Web ComponentsMichiel De Mey
 
MongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch TutorialMongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch TutorialMongoDB
 
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch TutorialMongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch TutorialMongoDB
 
Edge 2016 service workers and other front end techniques
Edge 2016 service workers and other front end techniquesEdge 2016 service workers and other front end techniques
Edge 2016 service workers and other front end techniquesakamaidevrel
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsChris Love
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talkDaiwei Lu
 
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch TutorialMongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch TutorialMongoDB
 
Moving from ASP.NET Web Forms to ASP.NET MVC
Moving from ASP.NET Web Forms to ASP.NET MVCMoving from ASP.NET Web Forms to ASP.NET MVC
Moving from ASP.NET Web Forms to ASP.NET MVCkgpainter
 
Ahmed Mohamed Awad Senior Web Developer
Ahmed Mohamed Awad Senior Web DeveloperAhmed Mohamed Awad Senior Web Developer
Ahmed Mohamed Awad Senior Web DeveloperAhmed Awad
 
XCS110_All_Slides.pdf
XCS110_All_Slides.pdfXCS110_All_Slides.pdf
XCS110_All_Slides.pdfssuser01066a
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...DataLeader.io
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pagesNilesh Bafna
 
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Patrick Meenan
 
Bp101-Can Domino Be Hacked
Bp101-Can Domino Be HackedBp101-Can Domino Be Hacked
Bp101-Can Domino Be HackedHoward Greenberg
 
Monitoring web application response times, a new approach
Monitoring web application response times, a new approachMonitoring web application response times, a new approach
Monitoring web application response times, a new approachMark Friedman
 

Ähnlich wie Building faster websites Front-end performance (20)

Polymer
Polymer Polymer
Polymer
 
A brave new web - A talk about Web Components
A brave new web - A talk about Web ComponentsA brave new web - A talk about Web Components
A brave new web - A talk about Web Components
 
MongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch TutorialMongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch Tutorial
 
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch TutorialMongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
 
Edge 2016 service workers and other front end techniques
Edge 2016 service workers and other front end techniquesEdge 2016 service workers and other front end techniques
Edge 2016 service workers and other front end techniques
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talk
 
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch TutorialMongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
 
Moving from ASP.NET Web Forms to ASP.NET MVC
Moving from ASP.NET Web Forms to ASP.NET MVCMoving from ASP.NET Web Forms to ASP.NET MVC
Moving from ASP.NET Web Forms to ASP.NET MVC
 
Ahmed Mohamed Awad Senior Web Developer
Ahmed Mohamed Awad Senior Web DeveloperAhmed Mohamed Awad Senior Web Developer
Ahmed Mohamed Awad Senior Web Developer
 
XCS110_All_Slides.pdf
XCS110_All_Slides.pdfXCS110_All_Slides.pdf
XCS110_All_Slides.pdf
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pages
 
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
 
Frameworks
FrameworksFrameworks
Frameworks
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 
Bp101-Can Domino Be Hacked
Bp101-Can Domino Be HackedBp101-Can Domino Be Hacked
Bp101-Can Domino Be Hacked
 
Monitoring web application response times, a new approach
Monitoring web application response times, a new approachMonitoring web application response times, a new approach
Monitoring web application response times, a new approach
 

Mehr von Mihai Oaida

Advanced Mysql - GeekMeet Timisoara
Advanced Mysql - GeekMeet TimisoaraAdvanced Mysql - GeekMeet Timisoara
Advanced Mysql - GeekMeet TimisoaraMihai Oaida
 
Notiuni avansate MySQL - Infoeducatie 2009
Notiuni avansate MySQL - Infoeducatie 2009Notiuni avansate MySQL - Infoeducatie 2009
Notiuni avansate MySQL - Infoeducatie 2009Mihai Oaida
 
jQuery - Infoeducatie 2008
jQuery - Infoeducatie 2008jQuery - Infoeducatie 2008
jQuery - Infoeducatie 2008Mihai Oaida
 
Arhitecturi de caching server-side - Infoeducatie 2008
Arhitecturi de caching server-side - Infoeducatie 2008 Arhitecturi de caching server-side - Infoeducatie 2008
Arhitecturi de caching server-side - Infoeducatie 2008 Mihai Oaida
 
Proiectarea si normalizarea bazelor de date - Infoeducatie 2008
Proiectarea si normalizarea bazelor de date - Infoeducatie 2008Proiectarea si normalizarea bazelor de date - Infoeducatie 2008
Proiectarea si normalizarea bazelor de date - Infoeducatie 2008Mihai Oaida
 
Arhitectura Si Managementul Proiectelor - Infoeducatie 2007
Arhitectura Si Managementul Proiectelor - Infoeducatie 2007Arhitectura Si Managementul Proiectelor - Infoeducatie 2007
Arhitectura Si Managementul Proiectelor - Infoeducatie 2007Mihai Oaida
 

Mehr von Mihai Oaida (6)

Advanced Mysql - GeekMeet Timisoara
Advanced Mysql - GeekMeet TimisoaraAdvanced Mysql - GeekMeet Timisoara
Advanced Mysql - GeekMeet Timisoara
 
Notiuni avansate MySQL - Infoeducatie 2009
Notiuni avansate MySQL - Infoeducatie 2009Notiuni avansate MySQL - Infoeducatie 2009
Notiuni avansate MySQL - Infoeducatie 2009
 
jQuery - Infoeducatie 2008
jQuery - Infoeducatie 2008jQuery - Infoeducatie 2008
jQuery - Infoeducatie 2008
 
Arhitecturi de caching server-side - Infoeducatie 2008
Arhitecturi de caching server-side - Infoeducatie 2008 Arhitecturi de caching server-side - Infoeducatie 2008
Arhitecturi de caching server-side - Infoeducatie 2008
 
Proiectarea si normalizarea bazelor de date - Infoeducatie 2008
Proiectarea si normalizarea bazelor de date - Infoeducatie 2008Proiectarea si normalizarea bazelor de date - Infoeducatie 2008
Proiectarea si normalizarea bazelor de date - Infoeducatie 2008
 
Arhitectura Si Managementul Proiectelor - Infoeducatie 2007
Arhitectura Si Managementul Proiectelor - Infoeducatie 2007Arhitectura Si Managementul Proiectelor - Infoeducatie 2007
Arhitectura Si Managementul Proiectelor - Infoeducatie 2007
 

Kürzlich hochgeladen

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
[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
 
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
 

Kürzlich hochgeladen (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[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
 
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
 

Building faster websites Front-end performance

  • 1. AIESEC IT School 2012 Building faster websites Front-end performance Mihai Oaida<mihai.oaida@gmail.com> 1
  • 2. About me  Mihai Oaida  Senior Web developer @imobiliare.ro  Student M.S.E. Politehnica Timișoara  http://www.slideshare.net/mihai.oaida Mihai Oaida<mihai.oaida@gmail.com> 2
  • 3. Agenda  Web application architecture  Web application performance  Frontend performance  The 14 rules  Other tips  Tools  Conclusions Mihai Oaida<mihai.oaida@gmail.com> 3
  • 4. Web application architecture Mihai Oaida<mihai.oaida@gmail.com> 4
  • 5. Web application architecture http://www.webpagetest.org/ Mihai Oaida<mihai.oaida@gmail.com> 5
  • 6. Web application performance  How do you measure it ?  How users react to it?  Why is it important? Mihai Oaida<mihai.oaida@gmail.com> 6
  • 7. JavaScript  Douglas Crockford on browsers: ”The most hostile software developement enviroment imaginable”  Wrote "JavaScript the Good Parts" Mihai Oaida<mihai.oaida@gmail.com> 7
  • 8. Frontend performance  Time spent on the client side  The client side model  80-90% of the total time  Factors  Host machine  Network bandwidth  Network latency  Number of web resources Mihai Oaida<mihai.oaida@gmail.com> 8
  • 9. The 14 rules  Rule 1: Make fewer HTTP requests  Use sprites for images  Merge css files  Merge js files  Use multiple subdomains  img1.tehnologii-web.ro  img2.tehnologii-web.ro Mihai Oaida<mihai.oaida@gmail.com> 9
  • 10. The 14 rules  Rule 2: Use a CDN ( Content delivery network ) or  Use dedicated server(s) just for static  Use asynchronous web servers: Lighthttpd, nginx  Use cookie free domains  TCP slow start  Rule 3: Add an Expires Header  Rule 4: Gzip Components Mihai Oaida<mihai.oaida@gmail.com> 10
  • 11. The 14 rules  Rule 5: Put Stylesheets at the Top  Rule 6: Put Scripts at the Bottom  Blocking scripts: document.write  <script src="script.js">/script> Mihai Oaida<mihai.oaida@gmail.com> 11
  • 12. The 14 rules  Rule 7: Avoid CSS Expressions  Rule 8: Make JavaScript and CSS External  Rule 9: Reduce DNS Lookups  Rule 10: Minify JavaScript Mihai Oaida<mihai.oaida@gmail.com> 12
  • 13. The 14 rules  Rule 11: Avoid Redirects  Rule 12: Remove Duplicate Scripts  Rule 13: Configure Etags  Rule 14: Make Ajax Cacheable Mihai Oaida<mihai.oaida@gmail.com> 13
  • 14. Lazy loading  scripts,Images,ads  70-80% downloaded code is not executed immediately for payloads of 100-300K  No blocking javascript  Example: google image search Mihai Oaida<mihai.oaida@gmail.com> 14
  • 15. Lazy execution  Execute js code faster than with eval() function sayHi(){ scriptContent = 'alert("hi")'; scriptElem = document.createElement('script'); head = document.getElementByTagName('head')[0] head.appendChild(scriptElem); scriptElem.text = scriptContent } Mihai Oaida<mihai.oaida@gmail.com> 15
  • 16. Lazy loading  Dynamic load script after page load function loadScript(){ scriptElem = document.createElement('script'); scriptElem.src = "http://domain.com/script.js"; head = document.getElementByTagName('head')[0] head.appendChild(scriptElem); } Mihai Oaida<mihai.oaida@gmail.com> 16
  • 17. Profiling  document end  download rate  parsing time  inline javascript execution  document load  on load event - all resources loaded Mihai Oaida<mihai.oaida@gmail.com> 17
  • 18. Profiling - After <head> <script type="text/javascript"> documentStart = new Date().getTime(); </script> Mihai Oaida<mihai.oaida@gmail.com> 18
  • 19. Profiling - Before </body> <script type="text/javascript"> documentEnd = new Date().getTime()-documentStart; jQuery(window).load(function(){ callbackUrl ='http://www.foo.ro/timing'; documentLoad = new Date().getTime()-documentStart; profileTokens = { 'document_end':documentEnd, 'document_load':documentLoad, 'page' : window.location.href.split('.ro')[1] }; Mihai Oaida<mihai.oaida@gmail.com> 19
  • 20. Profiling - Before </body> i=0; for(k in profileTokens) { delim = (i==0?'?':'&'); callbackUrl+= delim+k+'='+profileTokens[k]; i++; }; img = document.createElement('img'); img.src = callbackUrl; document.body.appendChild(img); }); </script> Mihai Oaida<mihai.oaida@gmail.com> 20
  • 21. Tools  Tools  HttpWatch  Wireshark  Firebug  Yslow  Web developement Tools  http://www.webpagetest.org/  http://smush.it/  Resources:  http://stevesouders.com/hpws/ Mihai Oaida<mihai.oaida@gmail.com> 21
  • 22. Conclusions  Each rule has a different impact  Rules are not all mandatory  Measure first  Measure after Mihai Oaida<mihai.oaida@gmail.com> 22