SlideShare a Scribd company logo
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

More Related Content

What's hot

Building Better WordPress Sites
Building Better WordPress SitesBuilding Better WordPress Sites
Building Better WordPress Sites
Brian LaFrance
 
Blazor certification training - Dot Net Tricks
Blazor certification training - Dot Net TricksBlazor certification training - Dot Net Tricks
Blazor certification training - Dot Net Tricks
Gaurav Singh
 
Ajax Presentation
Ajax PresentationAjax Presentation
Ajax Presentation
alaa.moustafa
 
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
Databarracks
 
Securing data and preventing data breaches
Securing data and preventing data breachesSecuring data and preventing data breaches
Securing data and preventing data breaches
MariaDB plc
 
Semi Structured Data
Semi Structured DataSemi Structured Data
Semi Structured Data
MariaDB plc
 
Squeezing Web Performance
Squeezing Web PerformanceSqueezing Web Performance
Squeezing Web Performance
Seven Peaks Speaks
 
Building a Drupal-driven Intranet
Building a Drupal-driven IntranetBuilding a Drupal-driven Intranet
Building a Drupal-driven Intranet
librarywebchic
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
Bharat_Kumawat
 
Cloud computing
Cloud computingCloud computing
Cloud computing
hwalice666
 
雲端運算 英文Ppt
雲端運算 英文Ppt雲端運算 英文Ppt
雲端運算 英文Ppt
hwalice666
 
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
Khoa Quach
 
Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016
Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016
Bioschemas - TeSS Integration @ Rothamsted Hackathon 2016
Niall Beard
 
Fast, Powerful and Scalable Analytics
Fast, Powerful and Scalable AnalyticsFast, Powerful and Scalable Analytics
Fast, Powerful and Scalable Analytics
MariaDB plc
 
Working with Data in Service Workers
Working with Data in Service WorkersWorking with Data in Service Workers
Working with Data in Service Workers
Gil Fink
 
Ajax
AjaxAjax
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-static
biilmann
 
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
NCCOMMS
 
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
Amazon Web Services
 

What's hot (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
 

Viewers also liked

K-Means
K-MeansK-Means
K-Means
Mihai Oaida
 
Notiuni avansate MySQL - Infoeducatie 2008
Notiuni avansate MySQL - Infoeducatie 2008Notiuni avansate MySQL - Infoeducatie 2008
Notiuni avansate MySQL - Infoeducatie 2008
Mihai Oaida
 
jQuery - GeekMeet Timisoara
jQuery - GeekMeet TimisoarajQuery - GeekMeet Timisoara
jQuery - GeekMeet Timisoara
Mihai 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 2009
Mihai Oaida
 
Notiuni avansate MySQL - LVLE 2009
Notiuni avansate MySQL - LVLE 2009Notiuni avansate MySQL - LVLE 2009
Notiuni avansate MySQL - LVLE 2009
Mihai 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 2008
Mihai Oaida
 
Linux/Unix-based Operating Systems
Linux/Unix-based Operating SystemsLinux/Unix-based Operating Systems
Linux/Unix-based Operating Systems
Mihai Oaida
 

Viewers also liked (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
 

Similar to 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 Components
Michiel De Mey
 
MongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch TutorialMongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB
 
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
MongoDB
 
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
akamaidevrel
 
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
Chris Love
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
Chris Love
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talk
Daiwei 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 Tutorial
MongoDB
 
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
kgpainter
 
Ahmed Mohamed Awad Senior Web Developer
Ahmed Mohamed Awad Senior Web DeveloperAhmed Mohamed Awad Senior Web Developer
Ahmed Mohamed Awad Senior Web Developer
Ahmed Awad
 
XCS110_All_Slides.pdf
XCS110_All_Slides.pdfXCS110_All_Slides.pdf
XCS110_All_Slides.pdf
ssuser01066a
 
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 pages
Nilesh 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
 
Frameworks
FrameworksFrameworks
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
Anup Hariharan Nair
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
Muhammad Hafiz Hasan
 
Bp101-Can Domino Be Hacked
Bp101-Can Domino Be HackedBp101-Can Domino Be Hacked
Bp101-Can Domino Be Hacked
Howard 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 approach
Mark Friedman
 

Similar to 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
 

More from Mihai Oaida

Advanced Mysql - GeekMeet Timisoara
Advanced Mysql - GeekMeet TimisoaraAdvanced Mysql - GeekMeet Timisoara
Advanced Mysql - GeekMeet Timisoara
Mihai Oaida
 
Notiuni avansate MySQL - Infoeducatie 2009
Notiuni avansate MySQL - Infoeducatie 2009Notiuni avansate MySQL - Infoeducatie 2009
Notiuni avansate MySQL - Infoeducatie 2009
Mihai Oaida
 
jQuery - Infoeducatie 2008
jQuery - Infoeducatie 2008jQuery - Infoeducatie 2008
jQuery - Infoeducatie 2008
Mihai 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 2008
Mihai Oaida
 
Arhitectura Si Managementul Proiectelor - Infoeducatie 2007
Arhitectura Si Managementul Proiectelor - Infoeducatie 2007Arhitectura Si Managementul Proiectelor - Infoeducatie 2007
Arhitectura Si Managementul Proiectelor - Infoeducatie 2007
Mihai Oaida
 

More from 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
 

Recently uploaded

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 

Recently uploaded (20)

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 

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