SlideShare a Scribd company logo
Client-Side Performance Sucks Craig Walker, Chief Technology Officer And what you can do to make it suck less. www.xero.com
Your typical internal network: Easier to control Easier to predict Knowledge of almost everything from LAN speed to operating system
There's a reason why the words “world” and “wide” are in the acronym Control and knowledge are limited to your own environment. Even how the packets fly around the internet is out of your control. www.xero.com
The HTTP Request Server Browser Receive Last Byte Send  Last Byte Send Data Establish  Connection Initial Connection Open Socket Initial HTTP Request First Byte Receive First Byte Send  First Byte Content Download ISP Get IP DNS Lookup
5% Server side performance often not the problem with response time 95% Most of the response time is taken up here
25% 75%
Empty Cache Primed Cache
Focus on the front-end 75-95% of the end-user response time for Xero customers is spent on the front end Much easier to optimise than server side performance Greater potential for improvement – especially from an end-users point-of-view Proven to work
Performance === Usability www.xero.com
The giants who’s shoulders I’m standing on Yahoo! Exceptional Performance team http://developer.yahoo.com/performance/ Steve Souders Former Chief of Performance at Yahoo! Now at Google Creator of YSlow and the 14 Rules Author of High Performance Web Sites Stoyan Stefanov, Patrick Meenan, Julien Lecomte, Stuart Colville, Ed Eliot and many more …
Zip It! Significantly reduces download size – 60-80% saving on text based content 90% of browsers support compression Benefits ALL users Zip everything you can html (aspx), js, css, xml, txt, json (ashx, axd) Benefits you too: Reduces traffic costs Doesn’t require code changes
Fly’s down Zipped
Reduce HTTP Requests Less components means a faster page Every request is an overhead Combine scripts Combine CSS Combine images into CSS Sprites Don’t rely on cache: 304’s are still requests
CSS Sprites Combine all small images into one large image Use CSS to control the displaying of each image
The designers want what? 11 Images 11 HTTP Requests 3.3 KB total size
Obey your thirst ® 1 Image 1 HTTP Request 1.6 KB total size
And the CSS? <div class=&quot;buttons&quot;> <span class=&quot;large green button&quot;> <button type=&quot;button&quot;> <span class=&quot;checkbox icon&quot;> Approve </span> </button> </span> <span class=&quot;large blue button&quot;> <button type=&quot;button&quot;> <span> Save </span> </button> </span> <span class=&quot;large red button&quot;> <button type=&quot;button&quot;> <span class=&quot;delete icon&quot;> Delete </span> </button> </span> <span class=&quot;medium gray button&quot;> <button type=&quot;button&quot;> <span class=&quot;delete icon&quot;> Cancel </span> </button> </span> </div> .buttons span.button { background:transparent url(buttons.png) no-repeat 0 0; } .buttons span.button button, .buttons span.button a { background:transparent url(buttons.png) no-repeat 100% -120px; } .buttons span.blue { background-position: 0 -30px; } .buttons span.blue button, .buttons span.blue a { background-position: 100% -150px; } .buttons span.red { background-position: 0 -60px; } .buttons span.red button, .buttons span.red a { background-position: 100% -180px; } .buttons span.green { background-position: 0 -90px; } .buttons span.green button, .buttons span.green a { background-position: 100% -210px; } The HTML The CSS
Maximise Parallel Downloads Most browsers are limited to 6 connections total and 2 connections per hostname Increase the number of hostnames to increase the number of parallel downloads  (e.g., go.xero.com, gos1.xero.com, gos2.xero.com) Don’t overdo it! (DNS lookups are expensive so limit 2-4 domains) Browser Parallel Downloads Firefox 2 2 Firefox 3 6 Internet Explorer 7 2 Internet Explorer 8 6 Safari 3.1 4 Safari 4.0 4
Maximise Parallel Downloads Stepped download  (with 1 hostname) Increased parallelism  (using 2 hostnames)
Use a CDN Content Delivery Network Distributes content closer to the last mile Distribute your static content before distributing your dynamic content Akamai most popular but very expensive Xero utilises a rudimentary CDN using IP lookup to determine location
How it works: Images JS CSS <xsl:value-of select=&quot;Page:RegisterCSS('/common/style/xero.css','screen')&quot;/> <xsl:value-of select=&quot;Page:RegisterJavascript('/common/scripts/xero.js'&quot;/>  <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot;  href=&quot;https://nzs1.xero.com/common/style/xero.css&quot; /> <script type=&quot;text/javascript&quot;  src=&quot;https://nzs2.xero.com/common/scripts/xero.js&quot;></script> GET Request Response with HTML document Get  location  from IP
Maximise the cache Understand the ratio of cached vs uncached Add an Expires header Not just for images – should be used on all static content Set a “Never expire” or far future expires policy if you can Reduces HTTP requests – once component is served, the browser never asks for it again Date stamping in file names makes it easier Remove ETags ETags are another caching mechanism – sent with every request Uniquely created per web server – not good in web farms Just turn them off and use Expires headers instead
CSS external and on top Move all inline CSS to external style sheets for both reuse and caching Put all style sheet references at the top Firefox and IE will block rendering until all the CSS is downloaded Use <link> and NOT @import In IE @import is the same as putting <link> at the bottom
JavaScript external and on the bottom Move scripts to external files for both reuse and caching Promotes better script design Push scripts as low as possible Often difficult with document.write or with inline calls requiring loaded JavaScript Be pragmatic – think about splitting JavaScript into “must be loaded” and “can be loaded on demand” Scripts will block both downloading and rendering until parsed Remove duplicate scripts (IE has a habit of downloading them again)
Notice the  parallel  download here … …  until we hit the JavaScript files where they come down sequentially, blocking any other downloads
Minify all static content CSS, JavaScript, XML, JSON, HTML can all be minified Not a replacement for gzipping but is a perfect accompaniment to it Lots of tools: JSMin CSSTidy YUI Compressor JavaScript obfuscation can also be useful – just test that your app still works afterwards
Optimise images Use PNGs instead of GIFs Avoid alpha filters – can block rendering and freeze the browser PNG8 is best and supported by IE6 (yes – even with transparency) Optimise further with PNGOUT or PNGCRUSH Make sure you have a favicon.ico Every browser will request it Best not to respond with a 404 Make it small and cacheable
Preloading … Preload components you’ll need in the future Unconditional preload  Xero login page preloads all core components so that the dashboard experience is better Conditional preload Often based on where you think a user might go to next
Reduce cookie weight Cookie’s are sent back with every request Keep cookie size small and only store what’s required – use server-side storage for everything else Consider cookie free domains for static content
Keep it clean Choose a good Ajax library – don’t go writing this stuff yourself Always asynchronous Use JSON over XML Accessing JSON faster and cheaper Less overhead than XML Use GET requests over POSTs wherever possible POST is a 2-step process: send headers, send body POST without a body is essentially a GET anyway And make sure the response is zipped!
Things to take away Focus on the front-end Be an advocate for your users Don’t let designers get in the way of performance But they will so optimise, optimise, optimise!
YSlow Firebug extension Grades performance – not about response times but about how well a site has adopted the techniques suggested Response time inversely proportional to YSlow score – get as close to an A as possible to get the maximum performance gain
Fiddler Microsoft built HTTP debugging proxy Inspect HTTP traffic, tamper with incoming and outgoing data and debug performance issues Works with all browsers
AOL PageTest Internal AOL utility gone public Browser plug-in for Internet Explorer Visually displays underlying requests and provides suggestions on how to improve your response times Also available as an external web-based tester at www.webpagetest.org
Any questions? www.xero.com
www.xero.com 0800 GET XERO

More Related Content

What's hot

Automated Testing with Google Chrome - WebDriver- ChromeDriver
Automated Testing with Google Chrome - WebDriver- ChromeDriverAutomated Testing with Google Chrome - WebDriver- ChromeDriver
Automated Testing with Google Chrome - WebDriver- ChromeDriver
Manoj Kumar Kumar
 
Do things faster and better with WebAssembly - Sendil Kumar Nellaiyapen - Cod...
Do things faster and better with WebAssembly - Sendil Kumar Nellaiyapen - Cod...Do things faster and better with WebAssembly - Sendil Kumar Nellaiyapen - Cod...
Do things faster and better with WebAssembly - Sendil Kumar Nellaiyapen - Cod...
Codemotion
 
How to make your site 5 times faster in 10 minutes
How to make your site 5 times faster in 10 minutesHow to make your site 5 times faster in 10 minutes
How to make your site 5 times faster in 10 minutes
Gal Baras
 
Front-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoftFront-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoft
Steve Wortham
 
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce LabsHow To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
Sauce Labs
 
Magento performancenbs
Magento performancenbsMagento performancenbs
Magento performancenbs
varien
 
WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & Tuning
Timothy Wood
 
Wordcamp2009
Wordcamp2009Wordcamp2009
Wordcamp2009
joetek
 
UXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXUXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UX
Stoian Dipchikov
 
Universal React apps in Next.js
Universal React apps in Next.jsUniversal React apps in Next.js
Universal React apps in Next.js
🐕 Łukasz Ostrowski
 
Metarefresh
MetarefreshMetarefresh
Metarefresh
Aakash Bapna
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Jonathan Klein
 
High Performance Web/Mobile Pages - Automation
High Performance Web/Mobile Pages - AutomationHigh Performance Web/Mobile Pages - Automation
High Performance Web/Mobile Pages - Automation
soheil416
 
DeepCrawl Webinar: Performing SEO on the Edge
DeepCrawl Webinar: Performing SEO on the EdgeDeepCrawl Webinar: Performing SEO on the Edge
DeepCrawl Webinar: Performing SEO on the Edge
Dan Taylor
 
How to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteHow to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! Site
Daniel Kanchev
 
SQL Server - CLR integration
SQL Server - CLR integrationSQL Server - CLR integration
SQL Server - CLR integration
Peter Gfader
 
NextJS - Online Summit for Frontend Developers September 2020
NextJS - Online Summit for Frontend Developers September 2020NextJS - Online Summit for Frontend Developers September 2020
NextJS - Online Summit for Frontend Developers September 2020
Milad Heydari
 
NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA  NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA
Pramendra Gupta
 
BDD in Java using Cucumber
BDD in Java using CucumberBDD in Java using Cucumber
BDD in Java using Cucumber
slavkurochkin
 
Web Cache Deception Attack
Web Cache Deception AttackWeb Cache Deception Attack
Web Cache Deception Attack
Omer Gil
 

What's hot (20)

Automated Testing with Google Chrome - WebDriver- ChromeDriver
Automated Testing with Google Chrome - WebDriver- ChromeDriverAutomated Testing with Google Chrome - WebDriver- ChromeDriver
Automated Testing with Google Chrome - WebDriver- ChromeDriver
 
Do things faster and better with WebAssembly - Sendil Kumar Nellaiyapen - Cod...
Do things faster and better with WebAssembly - Sendil Kumar Nellaiyapen - Cod...Do things faster and better with WebAssembly - Sendil Kumar Nellaiyapen - Cod...
Do things faster and better with WebAssembly - Sendil Kumar Nellaiyapen - Cod...
 
How to make your site 5 times faster in 10 minutes
How to make your site 5 times faster in 10 minutesHow to make your site 5 times faster in 10 minutes
How to make your site 5 times faster in 10 minutes
 
Front-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoftFront-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoft
 
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce LabsHow To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
 
Magento performancenbs
Magento performancenbsMagento performancenbs
Magento performancenbs
 
WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & Tuning
 
Wordcamp2009
Wordcamp2009Wordcamp2009
Wordcamp2009
 
UXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXUXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UX
 
Universal React apps in Next.js
Universal React apps in Next.jsUniversal React apps in Next.js
Universal React apps in Next.js
 
Metarefresh
MetarefreshMetarefresh
Metarefresh
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
 
High Performance Web/Mobile Pages - Automation
High Performance Web/Mobile Pages - AutomationHigh Performance Web/Mobile Pages - Automation
High Performance Web/Mobile Pages - Automation
 
DeepCrawl Webinar: Performing SEO on the Edge
DeepCrawl Webinar: Performing SEO on the EdgeDeepCrawl Webinar: Performing SEO on the Edge
DeepCrawl Webinar: Performing SEO on the Edge
 
How to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteHow to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! Site
 
SQL Server - CLR integration
SQL Server - CLR integrationSQL Server - CLR integration
SQL Server - CLR integration
 
NextJS - Online Summit for Frontend Developers September 2020
NextJS - Online Summit for Frontend Developers September 2020NextJS - Online Summit for Frontend Developers September 2020
NextJS - Online Summit for Frontend Developers September 2020
 
NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA  NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA
 
BDD in Java using Cucumber
BDD in Java using CucumberBDD in Java using Cucumber
BDD in Java using Cucumber
 
Web Cache Deception Attack
Web Cache Deception AttackWeb Cache Deception Attack
Web Cache Deception Attack
 

Viewers also liked

Client-side Performance Testing
Client-side Performance TestingClient-side Performance Testing
Client-side Performance Testing
Thoughtworks
 
Client-Side Performance Testing
Client-Side Performance TestingClient-Side Performance Testing
Client-Side Performance Testing
Anand Bagmar
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testing
Richard Bishop
 
Client-Side Performance Testing
Client-Side Performance TestingClient-Side Performance Testing
Client-Side Performance Testing
Anand Bagmar
 
Performance Testing
Performance TestingPerformance Testing
Performance Testing
sharmaparish
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testing
Tharinda Liyanage
 

Viewers also liked (6)

Client-side Performance Testing
Client-side Performance TestingClient-side Performance Testing
Client-side Performance Testing
 
Client-Side Performance Testing
Client-Side Performance TestingClient-Side Performance Testing
Client-Side Performance Testing
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testing
 
Client-Side Performance Testing
Client-Side Performance TestingClient-Side Performance Testing
Client-Side Performance Testing
 
Performance Testing
Performance TestingPerformance Testing
Performance Testing
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testing
 

Similar to Client Side Performance @ Xero

Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster Websites
Craig Walker
 
DrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingDrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizing
Ashok Modi
 
Going on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceGoing on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web Performance
Adam Norwood
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
Jason Ragsdale
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance Tuning
Brian Huff
 
Web performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukWeb performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.uk
gareth53
 
High Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesHigh Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practices
Stoyan Stefanov
 
Performance engineering
Performance engineeringPerformance engineering
Performance engineering
Franz Allan See
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
fakeaccount225095
 
Csdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer YahooCsdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer Yahoo
guestb1b95b
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
Siarhei Barysiuk
 
Speed!
Speed!Speed!
A little journey into website optimization
A little journey into website optimizationA little journey into website optimization
A little journey into website optimization
Stelian Firez
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
SiteGround.com
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
edm00se
 
Web Client Performance
Web Client PerformanceWeb Client Performance
Web Client Performance
Herea Adrian
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
davejohnson
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
sacred 8
 
High-Speed HTML5
High-Speed HTML5High-Speed HTML5
High-Speed HTML5
Peter Lubbers
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
Timothy Fisher
 

Similar to Client Side Performance @ Xero (20)

Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster Websites
 
DrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingDrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizing
 
Going on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceGoing on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web Performance
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance Tuning
 
Web performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukWeb performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.uk
 
High Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesHigh Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practices
 
Performance engineering
Performance engineeringPerformance engineering
Performance engineering
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
Csdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer YahooCsdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer Yahoo
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Speed!
Speed!Speed!
Speed!
 
A little journey into website optimization
A little journey into website optimizationA little journey into website optimization
A little journey into website optimization
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 
Web Client Performance
Web Client PerformanceWeb Client Performance
Web Client Performance
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
 
High-Speed HTML5
High-Speed HTML5High-Speed HTML5
High-Speed HTML5
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 

Recently uploaded

BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
Larry Smarr
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 

Recently uploaded (20)

BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 

Client Side Performance @ Xero

  • 1. Client-Side Performance Sucks Craig Walker, Chief Technology Officer And what you can do to make it suck less. www.xero.com
  • 2. Your typical internal network: Easier to control Easier to predict Knowledge of almost everything from LAN speed to operating system
  • 3. There's a reason why the words “world” and “wide” are in the acronym Control and knowledge are limited to your own environment. Even how the packets fly around the internet is out of your control. www.xero.com
  • 4. The HTTP Request Server Browser Receive Last Byte Send Last Byte Send Data Establish Connection Initial Connection Open Socket Initial HTTP Request First Byte Receive First Byte Send First Byte Content Download ISP Get IP DNS Lookup
  • 5. 5% Server side performance often not the problem with response time 95% Most of the response time is taken up here
  • 8. Focus on the front-end 75-95% of the end-user response time for Xero customers is spent on the front end Much easier to optimise than server side performance Greater potential for improvement – especially from an end-users point-of-view Proven to work
  • 10. The giants who’s shoulders I’m standing on Yahoo! Exceptional Performance team http://developer.yahoo.com/performance/ Steve Souders Former Chief of Performance at Yahoo! Now at Google Creator of YSlow and the 14 Rules Author of High Performance Web Sites Stoyan Stefanov, Patrick Meenan, Julien Lecomte, Stuart Colville, Ed Eliot and many more …
  • 11. Zip It! Significantly reduces download size – 60-80% saving on text based content 90% of browsers support compression Benefits ALL users Zip everything you can html (aspx), js, css, xml, txt, json (ashx, axd) Benefits you too: Reduces traffic costs Doesn’t require code changes
  • 13. Reduce HTTP Requests Less components means a faster page Every request is an overhead Combine scripts Combine CSS Combine images into CSS Sprites Don’t rely on cache: 304’s are still requests
  • 14. CSS Sprites Combine all small images into one large image Use CSS to control the displaying of each image
  • 15. The designers want what? 11 Images 11 HTTP Requests 3.3 KB total size
  • 16. Obey your thirst ® 1 Image 1 HTTP Request 1.6 KB total size
  • 17. And the CSS? <div class=&quot;buttons&quot;> <span class=&quot;large green button&quot;> <button type=&quot;button&quot;> <span class=&quot;checkbox icon&quot;> Approve </span> </button> </span> <span class=&quot;large blue button&quot;> <button type=&quot;button&quot;> <span> Save </span> </button> </span> <span class=&quot;large red button&quot;> <button type=&quot;button&quot;> <span class=&quot;delete icon&quot;> Delete </span> </button> </span> <span class=&quot;medium gray button&quot;> <button type=&quot;button&quot;> <span class=&quot;delete icon&quot;> Cancel </span> </button> </span> </div> .buttons span.button { background:transparent url(buttons.png) no-repeat 0 0; } .buttons span.button button, .buttons span.button a { background:transparent url(buttons.png) no-repeat 100% -120px; } .buttons span.blue { background-position: 0 -30px; } .buttons span.blue button, .buttons span.blue a { background-position: 100% -150px; } .buttons span.red { background-position: 0 -60px; } .buttons span.red button, .buttons span.red a { background-position: 100% -180px; } .buttons span.green { background-position: 0 -90px; } .buttons span.green button, .buttons span.green a { background-position: 100% -210px; } The HTML The CSS
  • 18. Maximise Parallel Downloads Most browsers are limited to 6 connections total and 2 connections per hostname Increase the number of hostnames to increase the number of parallel downloads (e.g., go.xero.com, gos1.xero.com, gos2.xero.com) Don’t overdo it! (DNS lookups are expensive so limit 2-4 domains) Browser Parallel Downloads Firefox 2 2 Firefox 3 6 Internet Explorer 7 2 Internet Explorer 8 6 Safari 3.1 4 Safari 4.0 4
  • 19. Maximise Parallel Downloads Stepped download (with 1 hostname) Increased parallelism (using 2 hostnames)
  • 20. Use a CDN Content Delivery Network Distributes content closer to the last mile Distribute your static content before distributing your dynamic content Akamai most popular but very expensive Xero utilises a rudimentary CDN using IP lookup to determine location
  • 21. How it works: Images JS CSS <xsl:value-of select=&quot;Page:RegisterCSS('/common/style/xero.css','screen')&quot;/> <xsl:value-of select=&quot;Page:RegisterJavascript('/common/scripts/xero.js'&quot;/> <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; href=&quot;https://nzs1.xero.com/common/style/xero.css&quot; /> <script type=&quot;text/javascript&quot; src=&quot;https://nzs2.xero.com/common/scripts/xero.js&quot;></script> GET Request Response with HTML document Get location from IP
  • 22. Maximise the cache Understand the ratio of cached vs uncached Add an Expires header Not just for images – should be used on all static content Set a “Never expire” or far future expires policy if you can Reduces HTTP requests – once component is served, the browser never asks for it again Date stamping in file names makes it easier Remove ETags ETags are another caching mechanism – sent with every request Uniquely created per web server – not good in web farms Just turn them off and use Expires headers instead
  • 23. CSS external and on top Move all inline CSS to external style sheets for both reuse and caching Put all style sheet references at the top Firefox and IE will block rendering until all the CSS is downloaded Use <link> and NOT @import In IE @import is the same as putting <link> at the bottom
  • 24. JavaScript external and on the bottom Move scripts to external files for both reuse and caching Promotes better script design Push scripts as low as possible Often difficult with document.write or with inline calls requiring loaded JavaScript Be pragmatic – think about splitting JavaScript into “must be loaded” and “can be loaded on demand” Scripts will block both downloading and rendering until parsed Remove duplicate scripts (IE has a habit of downloading them again)
  • 25. Notice the parallel download here … … until we hit the JavaScript files where they come down sequentially, blocking any other downloads
  • 26. Minify all static content CSS, JavaScript, XML, JSON, HTML can all be minified Not a replacement for gzipping but is a perfect accompaniment to it Lots of tools: JSMin CSSTidy YUI Compressor JavaScript obfuscation can also be useful – just test that your app still works afterwards
  • 27. Optimise images Use PNGs instead of GIFs Avoid alpha filters – can block rendering and freeze the browser PNG8 is best and supported by IE6 (yes – even with transparency) Optimise further with PNGOUT or PNGCRUSH Make sure you have a favicon.ico Every browser will request it Best not to respond with a 404 Make it small and cacheable
  • 28. Preloading … Preload components you’ll need in the future Unconditional preload Xero login page preloads all core components so that the dashboard experience is better Conditional preload Often based on where you think a user might go to next
  • 29. Reduce cookie weight Cookie’s are sent back with every request Keep cookie size small and only store what’s required – use server-side storage for everything else Consider cookie free domains for static content
  • 30. Keep it clean Choose a good Ajax library – don’t go writing this stuff yourself Always asynchronous Use JSON over XML Accessing JSON faster and cheaper Less overhead than XML Use GET requests over POSTs wherever possible POST is a 2-step process: send headers, send body POST without a body is essentially a GET anyway And make sure the response is zipped!
  • 31. Things to take away Focus on the front-end Be an advocate for your users Don’t let designers get in the way of performance But they will so optimise, optimise, optimise!
  • 32. YSlow Firebug extension Grades performance – not about response times but about how well a site has adopted the techniques suggested Response time inversely proportional to YSlow score – get as close to an A as possible to get the maximum performance gain
  • 33. Fiddler Microsoft built HTTP debugging proxy Inspect HTTP traffic, tamper with incoming and outgoing data and debug performance issues Works with all browsers
  • 34. AOL PageTest Internal AOL utility gone public Browser plug-in for Internet Explorer Visually displays underlying requests and provides suggestions on how to improve your response times Also available as an external web-based tester at www.webpagetest.org