SlideShare a Scribd company logo
1 of 21
Performance optimization
ID meeting
13 th January 2010

Filip Mares
Agenda
•Why Optimise Front-End?
•Importance of performance
•34 best practices
•Optimize CSS for faster browser rendering
•Write efficient CSS
•Minify CSS
Why Optimise Front-End?
• More potential for improvement
• Typically require less time = lower costs
• It’s proven to work
Importance of performance
• Better user experience
• More traffic
+0.4s = 5-9% drop in full-page traffic (Yahoo!)
• More revenue
+1sec = 2.8% drop in revenue
• Reduced costs
HW costs, bandwidth costs
Make it right
before you make it fast
34 best practices (by YDN)
1. Make fewer HTTP Requests

18. Preload Components

2. Use a Content Delivery Network

19. Reduce the Number of DOM Elements

3. Add an Expires or a Cache-Control Header

20. Split Components Across Domains

4. Gzip Components

21. Minimize the Number of iframes

5. Put Style sheets at the Top

22. No 404s

6. Put Scripts at the Bottom

23. Reduce Cookie Size

7. Avoid CSS Expressions

24. Use Cookie-free Domains for Components

8. Make JavaScript and CSS External

25. Minimize DOM Access

9. Reduce DNS Lookups

26. Develop Smart Event Handlers

10. Minify JavaScript and CSS

27. Choose <link> over @import

11. Avoid Redirects

28. Avoid Filters

12. Remove Duplicate JS and CSS

29. Optimize Images

13. Configure ETags

30. Optimize CSS Sprites

14. Make Ajax Cacheable

31. Don’t Scale Images in HTML

15. Flush the Buffer Early

32. Make favicon.ico Small and Cacheable

16. Use GET for Ajax Requests

33. Keep Components under 25K

17. Post-load Components

34. Pack Components into a Multipart Document
23 best practices for IDs
1. Make fewer HTTP Requests

18. Preload Components

2. Use a Content Delivery Network

19. Reduce the Number of DOM Elements

3. Add an Expires or a Cache-Control Header

20. Split Components Across Domains

4. Gzip Components

21. Minimize the Number of iframes

5. Put Style sheets at the Top

22. No 404s

6. Put Scripts at the Bottom

23. Reduce Cookie Size

7. Avoid CSS Expressions

24. Use Cookie-free Domains for Components

8. Make JavaScript and CSS External

25. Minimize DOM Access

9. Reduce DNS Lookups

26. Develop Smart Event Handlers

10. Minify JavaScript and CSS

27. Choose <link> over @import

11. Avoid Redirects

28. Avoid Filters

12. Remove Duplicate JS and CSS

29. Optimize Images

13. Configure ETags

30. Optimize CSS Sprites

14. Make Ajax Cacheable

31. Don’t Scale Images in HTML

15. Flush the Buffer Early

32. Make favicon.ico Small and Cacheable

16. Use GET for Ajax Requests

33. Keep Components under 25K

17. Post-load Components

34. Pack Components into a Multipart Document
Optimize CSS
for faster browser rendering
Less HTTP requests
• Combine CSS files
No separate print CSS
• Inline images with data
background‐image: url("data:image/png;base64,iVBORw0KG...");
• Lazy-load stylesheets used by JavaScript
CSS files on demand
Less HTTP requests - drawback
•Bigger files or more combinations to cache
•Not as nice as atomic components
•Inline images does not work in IE up to IE7
•Hard to make even small changes
•Need of new filename when the „never expire“ policy is on
Other CSS optimization practices
•Put CSS in the document head
•Make CSS External
•Choose <link> over @import
•Avoid Filters
•Avoid CSS expressions
•Specify image dimensions
Write efficient CSS
Descendants and child
selectors can affect
performance, but don’t
worry about them so much
as to not use them.
Efficient CSS practices
•Group selectors with common declarations

•Use CSS shorthand

#nav {text-align: center}
#main{text-align: center}
#nav, #main{text-align: center}

#nav {margin:2em 1em 3em 1em; padding: 0em;
color:#ffcc00}
#nav {margin:2em 1em 3em; padding: 0; color:#fc0}

•Group declarations with common selectors

•Abbreviate long class and ID names

#nav {text-align: center}
#nav {color:#eee}
#nav {text-align: center; color:#eee}

•Combine common styles into shared classes
•Keep the cascade in mind
•Use inheritance to eliminate duplicate
declarations
•Remove unused CSS

•Make rules as specific as possible
•Avoid universal rules
•Remove redundant qualifiers
•Avoid descendant selectors, especially those
that specify redundant ancestors
•Avoid the :hover pseudo-selector for non-link
elements for IE clients
Inefficient rules
•Rules with descendant selectors
body *
ul li a
•Rules with child or adjacent selectors
body > *
ul > li > a
•Rules with overly qualified selectors
form#UserLogin
•Rules that apply the :hover pseudo-selector to non-link elements
h3:hover
Minify CSS
Tested tools
•Clean CSS
•CSS Optimiser
•Icey CSS Compressor
•YUI Compressor
•flumpCakes Optimiser
Tested tools - results
Tool Used

File Size

Lines

compression ratio:

None

12,875

227

Original

Clean CSS

11,735

940

9%

CSS Optimiser

11,304

2

12%

Icey CSS Compressor

10,383

1

19%

YUI Compressor

11,175

1

13%

796

0%

Flumpcakes Optimiser 12,885
Questions?
Thanks
for listening
Links
•Best Practices for Speeding Up Your Web Site
http://developer.yahoo.com/performance/rules.html

•Testing CSS Performance
http://blog.archive.jpsykes.com/151/testing-css-performance/

•Performance Impact of CSS Selectors
http://www.stevesouders.com/blog/2009/03/10/performance-impact-of-css-selectors/

•Optimize browser rendering
http://code.google.com/speed/page-speed/docs/rendering.html

•CSS Optimization: Make Your Sites Load Faster for Free
http://www.bloggingpro.com/archives/2006/08/17/css-optimization/

More Related Content

What's hot

Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)Bill Condo
 
The server side story: Parallel and Asynchronous programming in .NET - ITPro...
The server side story:  Parallel and Asynchronous programming in .NET - ITPro...The server side story:  Parallel and Asynchronous programming in .NET - ITPro...
The server side story: Parallel and Asynchronous programming in .NET - ITPro...Panagiotis Kanavos
 
Getting Started with Web Services
Getting Started with Web ServicesGetting Started with Web Services
Getting Started with Web ServicesDataNext Solutions
 
Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsBrettTasker
 
Benchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and ResultsBenchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and ResultsNGINX, Inc.
 
ASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDPhil Pursglove
 
Building a better web
Building a better webBuilding a better web
Building a better webFastly
 
Level Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress PerformanceLevel Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress PerformancePantheon
 
Why Wordnik went non-relational
Why Wordnik went non-relationalWhy Wordnik went non-relational
Why Wordnik went non-relationalTony Tam
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonPhil Pursglove
 
Supporting large scale React applications
Supporting large scale React applicationsSupporting large scale React applications
Supporting large scale React applicationsMaurice De Beijer [MVP]
 
Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service BusPavel Revenkov
 
A Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceA Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceValeri Karpov
 
Building large scalable mission critical business applications on the web
Building large scalable mission critical business applications on the webBuilding large scalable mission critical business applications on the web
Building large scalable mission critical business applications on the webMaurice De Beijer [MVP]
 
Inside election night at The New York Times | Altitude NYC
Inside election night at The New York Times | Altitude NYCInside election night at The New York Times | Altitude NYC
Inside election night at The New York Times | Altitude NYCFastly
 
4th Lecture: JSP and such
4th Lecture:  JSP and such4th Lecture:  JSP and such
4th Lecture: JSP and suchManolis Vavalis
 
Keeping the Lights On with MongoDB
Keeping the Lights On with MongoDBKeeping the Lights On with MongoDB
Keeping the Lights On with MongoDBTony Tam
 
Living on the Edge: Elevating your SEO toolkit to the CDN
Living on the Edge: Elevating your SEO toolkit to the CDNLiving on the Edge: Elevating your SEO toolkit to the CDN
Living on the Edge: Elevating your SEO toolkit to the CDNNils De Moor
 
Caching your rails application
Caching your rails applicationCaching your rails application
Caching your rails applicationArrrrCamp
 

What's hot (20)

Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
 
The server side story: Parallel and Asynchronous programming in .NET - ITPro...
The server side story:  Parallel and Asynchronous programming in .NET - ITPro...The server side story:  Parallel and Asynchronous programming in .NET - ITPro...
The server side story: Parallel and Asynchronous programming in .NET - ITPro...
 
Getting Started with Web Services
Getting Started with Web ServicesGetting Started with Web Services
Getting Started with Web Services
 
Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applications
 
Benchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and ResultsBenchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and Results
 
Node js
Node jsNode js
Node js
 
ASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDASP.NET Scalability - WebDD
ASP.NET Scalability - WebDD
 
Building a better web
Building a better webBuilding a better web
Building a better web
 
Level Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress PerformanceLevel Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress Performance
 
Why Wordnik went non-relational
Why Wordnik went non-relationalWhy Wordnik went non-relational
Why Wordnik went non-relational
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG London
 
Supporting large scale React applications
Supporting large scale React applicationsSupporting large scale React applications
Supporting large scale React applications
 
Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service Bus
 
A Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceA Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-Service
 
Building large scalable mission critical business applications on the web
Building large scalable mission critical business applications on the webBuilding large scalable mission critical business applications on the web
Building large scalable mission critical business applications on the web
 
Inside election night at The New York Times | Altitude NYC
Inside election night at The New York Times | Altitude NYCInside election night at The New York Times | Altitude NYC
Inside election night at The New York Times | Altitude NYC
 
4th Lecture: JSP and such
4th Lecture:  JSP and such4th Lecture:  JSP and such
4th Lecture: JSP and such
 
Keeping the Lights On with MongoDB
Keeping the Lights On with MongoDBKeeping the Lights On with MongoDB
Keeping the Lights On with MongoDB
 
Living on the Edge: Elevating your SEO toolkit to the CDN
Living on the Edge: Elevating your SEO toolkit to the CDNLiving on the Edge: Elevating your SEO toolkit to the CDN
Living on the Edge: Elevating your SEO toolkit to the CDN
 
Caching your rails application
Caching your rails applicationCaching your rails application
Caching your rails application
 

Viewers also liked

Anatomie mobilního webu
Anatomie mobilního webuAnatomie mobilního webu
Anatomie mobilního webuFilip Mares
 
Let’s practice critical thinking
Let’s practice critical thinkingLet’s practice critical thinking
Let’s practice critical thinkingcoop8
 
Komponenty v kaskákdě
Komponenty v kaskákděKomponenty v kaskákdě
Komponenty v kaskákděFilip Mares
 
HTML5 Geolocation API
HTML5 Geolocation APIHTML5 Geolocation API
HTML5 Geolocation APIFilip Mares
 

Viewers also liked (6)

Anatomie mobilního webu
Anatomie mobilního webuAnatomie mobilního webu
Anatomie mobilního webu
 
Let’s practice critical thinking
Let’s practice critical thinkingLet’s practice critical thinking
Let’s practice critical thinking
 
Proofread symbols
Proofread symbolsProofread symbols
Proofread symbols
 
Komponenty v kaskákdě
Komponenty v kaskákděKomponenty v kaskákdě
Komponenty v kaskákdě
 
HTML5 Geolocation API
HTML5 Geolocation APIHTML5 Geolocation API
HTML5 Geolocation API
 
77094122 report-on-aarong-part-two
77094122 report-on-aarong-part-two77094122 report-on-aarong-part-two
77094122 report-on-aarong-part-two
 

Similar to Performance optimization - Basics

High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsSiarhei Barysiuk
 
Web performance optimization for modern web applications
Web performance optimization for modern web applicationsWeb performance optimization for modern web applications
Web performance optimization for modern web applicationsChris Love
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pagesNilesh Bafna
 
Frontend performance
Frontend performanceFrontend performance
Frontend performancesacred 8
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek editionChris Love
 
Performace optimization (increase website speed)
Performace optimization (increase website speed)Performace optimization (increase website speed)
Performace optimization (increase website speed)clickramanm
 
High performance website
High performance websiteHigh performance website
High performance websiteChamnap Chhorn
 
10 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 201610 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 2016Chris Love
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Deepak Sharma
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tipsChris Love
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSZoe Gillenwater
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App TodayChris Love
 
Advanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & EfficiencyAdvanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & EfficiencyDenise Jacobs
 
Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster WebsitesCraig Walker
 
Drupal front-end performance
Drupal front-end performance Drupal front-end performance
Drupal front-end performance ADCI Solutions
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS TroubleshootingDenise Jacobs
 
Website Performance
Website PerformanceWebsite Performance
Website PerformanceHugo Fonseca
 

Similar to Performance optimization - Basics (20)

High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Web performance optimization for modern web applications
Web performance optimization for modern web applicationsWeb performance optimization for modern web applications
Web performance optimization for modern web applications
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pages
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek edition
 
Performace optimization (increase website speed)
Performace optimization (increase website speed)Performace optimization (increase website speed)
Performace optimization (increase website speed)
 
High performance website
High performance websiteHigh performance website
High performance website
 
10 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 201610 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 2016
 
Speed!
Speed!Speed!
Speed!
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSS
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today
 
Advanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & EfficiencyAdvanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & Efficiency
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster Websites
 
Drupal front-end performance
Drupal front-end performance Drupal front-end performance
Drupal front-end performance
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS Troubleshooting
 
Performance tuning of Websites
Performance tuning of WebsitesPerformance tuning of Websites
Performance tuning of Websites
 
Website Performance
Website PerformanceWebsite Performance
Website Performance
 

Recently uploaded

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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
 
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
 
[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
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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
 
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
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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
 
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
 
[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
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech 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...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Performance optimization - Basics

  • 1. Performance optimization ID meeting 13 th January 2010 Filip Mares
  • 2. Agenda •Why Optimise Front-End? •Importance of performance •34 best practices •Optimize CSS for faster browser rendering •Write efficient CSS •Minify CSS
  • 3. Why Optimise Front-End? • More potential for improvement • Typically require less time = lower costs • It’s proven to work
  • 4. Importance of performance • Better user experience • More traffic +0.4s = 5-9% drop in full-page traffic (Yahoo!) • More revenue +1sec = 2.8% drop in revenue • Reduced costs HW costs, bandwidth costs
  • 5. Make it right before you make it fast
  • 6. 34 best practices (by YDN) 1. Make fewer HTTP Requests 18. Preload Components 2. Use a Content Delivery Network 19. Reduce the Number of DOM Elements 3. Add an Expires or a Cache-Control Header 20. Split Components Across Domains 4. Gzip Components 21. Minimize the Number of iframes 5. Put Style sheets at the Top 22. No 404s 6. Put Scripts at the Bottom 23. Reduce Cookie Size 7. Avoid CSS Expressions 24. Use Cookie-free Domains for Components 8. Make JavaScript and CSS External 25. Minimize DOM Access 9. Reduce DNS Lookups 26. Develop Smart Event Handlers 10. Minify JavaScript and CSS 27. Choose <link> over @import 11. Avoid Redirects 28. Avoid Filters 12. Remove Duplicate JS and CSS 29. Optimize Images 13. Configure ETags 30. Optimize CSS Sprites 14. Make Ajax Cacheable 31. Don’t Scale Images in HTML 15. Flush the Buffer Early 32. Make favicon.ico Small and Cacheable 16. Use GET for Ajax Requests 33. Keep Components under 25K 17. Post-load Components 34. Pack Components into a Multipart Document
  • 7. 23 best practices for IDs 1. Make fewer HTTP Requests 18. Preload Components 2. Use a Content Delivery Network 19. Reduce the Number of DOM Elements 3. Add an Expires or a Cache-Control Header 20. Split Components Across Domains 4. Gzip Components 21. Minimize the Number of iframes 5. Put Style sheets at the Top 22. No 404s 6. Put Scripts at the Bottom 23. Reduce Cookie Size 7. Avoid CSS Expressions 24. Use Cookie-free Domains for Components 8. Make JavaScript and CSS External 25. Minimize DOM Access 9. Reduce DNS Lookups 26. Develop Smart Event Handlers 10. Minify JavaScript and CSS 27. Choose <link> over @import 11. Avoid Redirects 28. Avoid Filters 12. Remove Duplicate JS and CSS 29. Optimize Images 13. Configure ETags 30. Optimize CSS Sprites 14. Make Ajax Cacheable 31. Don’t Scale Images in HTML 15. Flush the Buffer Early 32. Make favicon.ico Small and Cacheable 16. Use GET for Ajax Requests 33. Keep Components under 25K 17. Post-load Components 34. Pack Components into a Multipart Document
  • 8. Optimize CSS for faster browser rendering
  • 9. Less HTTP requests • Combine CSS files No separate print CSS • Inline images with data background‐image: url("data:image/png;base64,iVBORw0KG..."); • Lazy-load stylesheets used by JavaScript CSS files on demand
  • 10. Less HTTP requests - drawback •Bigger files or more combinations to cache •Not as nice as atomic components •Inline images does not work in IE up to IE7 •Hard to make even small changes •Need of new filename when the „never expire“ policy is on
  • 11. Other CSS optimization practices •Put CSS in the document head •Make CSS External •Choose <link> over @import •Avoid Filters •Avoid CSS expressions •Specify image dimensions
  • 13. Descendants and child selectors can affect performance, but don’t worry about them so much as to not use them.
  • 14. Efficient CSS practices •Group selectors with common declarations •Use CSS shorthand #nav {text-align: center} #main{text-align: center} #nav, #main{text-align: center} #nav {margin:2em 1em 3em 1em; padding: 0em; color:#ffcc00} #nav {margin:2em 1em 3em; padding: 0; color:#fc0} •Group declarations with common selectors •Abbreviate long class and ID names #nav {text-align: center} #nav {color:#eee} #nav {text-align: center; color:#eee} •Combine common styles into shared classes •Keep the cascade in mind •Use inheritance to eliminate duplicate declarations •Remove unused CSS •Make rules as specific as possible •Avoid universal rules •Remove redundant qualifiers •Avoid descendant selectors, especially those that specify redundant ancestors •Avoid the :hover pseudo-selector for non-link elements for IE clients
  • 15. Inefficient rules •Rules with descendant selectors body * ul li a •Rules with child or adjacent selectors body > * ul > li > a •Rules with overly qualified selectors form#UserLogin •Rules that apply the :hover pseudo-selector to non-link elements h3:hover
  • 17. Tested tools •Clean CSS •CSS Optimiser •Icey CSS Compressor •YUI Compressor •flumpCakes Optimiser
  • 18. Tested tools - results Tool Used File Size Lines compression ratio: None 12,875 227 Original Clean CSS 11,735 940 9% CSS Optimiser 11,304 2 12% Icey CSS Compressor 10,383 1 19% YUI Compressor 11,175 1 13% 796 0% Flumpcakes Optimiser 12,885
  • 21. Links •Best Practices for Speeding Up Your Web Site http://developer.yahoo.com/performance/rules.html •Testing CSS Performance http://blog.archive.jpsykes.com/151/testing-css-performance/ •Performance Impact of CSS Selectors http://www.stevesouders.com/blog/2009/03/10/performance-impact-of-css-selectors/ •Optimize browser rendering http://code.google.com/speed/page-speed/docs/rendering.html •CSS Optimization: Make Your Sites Load Faster for Free http://www.bloggingpro.com/archives/2006/08/17/css-optimization/