Your SlideShare is downloading. ×
Making your Website Faster
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Making your Website Faster


Published on

"What is fast and how much faster can we be?". Many typical industry leading sites can be sped up by up to 2 seconds following easy to implement best practices. 2 seconds that make a huge difference …

"What is fast and how much faster can we be?". Many typical industry leading sites can be sped up by up to 2 seconds following easy to implement best practices. 2 seconds that make a huge difference in the competitive advantage.

In this tutorial we dig into "How the Web Works under the Hood", "What's going on in the Browser" and "How your Coding affects Load Time, Rendering Behavior and Page Interactivity". After digging into the architecture we look at "Key Web Performance Metrics", their importance and how to track and optimize them. We look at good and bad example web sites to learn how to best optimize our end-user perceived performance using free available tools for the major browsers.

Once optimized it is important to stay optimized. Automating performance anlysis is no rocket science. We learn how to implement an automated performance analysis environment to identify new problems as they appear

Key Takeaways

What are the top problems that make websites slow?
Which tools can I use to analyze my web site in different browsers?
What are some of the techniques to speed up my web site?

Presented by Andi Grabner, Technology Strategist, dynaTrace-Compuware Center of Excellence, at the QCon Conference, March 2011

Published in: Technology

  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Making Your WebSite FasterTutorial @ QCon 2011
  • 2. Agenda• Tool Landscape• Web 2.0 Basics• Top Problems that make pages slow• What can I do to optimize my page• Automation
  • 3. Browser Extensions• Internet Explorer • dynaTrace AJAX Edition • IE Developer Tools• Firefox • Firebug • YSlow and PageSpeed• Chrome • SpeedTracer • PageSpeed
  • 4. Network Analysis• Proxy Approach • HTTPWatch - • Fiddler -• Testing Services • •
  • 5. Hands-On• Download and Install Tools
  • 6. The Web 2.0 Basics Datavolume Latency JavaScript DOM NetworkRendering AJAX/XHR Browser Calls Server Layouting Caching
  • 7. Loading a Web Page
  • 8. Loading a Web Page – High Level KPIs • Page Characteristics • Number of Requests • Number of XHR Requests • Page Size • Page Loading • First Impression • onLoad Time • Fully Loaded • Network • DNS, Connect, Network and Wait Time • Client vs. Server • Time Spent in JavaScript vs. Server Download timeMore:
  • 9. Loading a Web Page - Network Waterfall influenced by time of resource reference and connection limitsMore:
  • 10. Loading a Web Page - JavaScript • JavaScript gets executed • After a JavaScript file got loaded • When certain events trigger, e.g: onLoad, Mouse or Keyboard, Navigation, AJAX Completed, … Script gets executed Event handlers get when fully loaded executed by the browser JavaScript gets executedMore:
  • 11. Loading a Web Page - Rendering • Rendering happens mostly asynchronously • Rendering tasks get into a Queue • Browser processes the Queue • When certain objects get downloaded (HTML Document, Images, CSS) • When there is time • When it is necessary (somebody needs layout information)More:
  • 12. Hands-On• Analyze Load Activities of
  • 13. #1 Problem – Overloaded Web Sites• Too many resources,• Unoptimizied content 13
  • 14. #2 JavaScript Executions• Not optimized for specific browsers 14
  • 15. #3 Caching• No Caching or Wrong usage of CDNs 15
  • 16. #4 Slow External Content• Ads, Banners, Social Network Plugins, … 16
  • 17. Proactive Performance Optimization• Leverage Browser Caching• Reduce Network Roundtrips• Optimize JavaScript• Optimize DOM Manipulations• Analyze external Content• Optimize AJAX Usage• Analyze Rendering
  • 18. Leverage Client-Side Caching• Instruct Browser and Proxy to Cache Content • To be used for static content • Enhance Browsing Experience for re-visiting users (Browser Cache) • Enhance Browsing Experience for users on same Proxy • Reduces Network Roundtrips • Reduces Bandwidth Requirements • Reduces load on server Serverside Server providing Data Cache Caching Information Cache per Client Server Proxy Cache Clients for Many Clients
  • 19. Leverage Browser Caching• HTTP Protocol defines Cache Headers • Date • defines the timestamp of the resource download • Expires • Defines how long this resource is valid • E-Tag • Uniquely identifies a resource • Cache-Control • Defines caching strategy • Last-Modified • Defines when the resource was last modified
  • 20. Leverage Browser Caching• E-Tag and Last-Modified Resource Changed Resource Not Changed Browser Server Browser Server If-Modified-Since If-Modified-Since If-None-Match If-None-Match 200 OK 304 Not Modified… we still have wait/DNS/connect/request/server time
  • 21. Leverage Browser Caching• max-age (Cache-Control) and Expires Browser Server GET … * Combine with E-Tag for max-age:10 even more performance No download for 10 seconds
  • 22. Leverage Browser Caching• Analyze HTTP Response Headers • Which resources are not cached at all • Which resources are not correctly cached (short expiration, exp in the past, …)
  • 23. Leverage Browser Caching• Use Content Delivery Networks (CDN) • E.g.: Akamai, …• Advantage • Brings content closer to the end-user• Disadvantage • Requires End User Monitoring
  • 24. Hands-On• Analyze Caching Behavior
  • 25. Reduce Network Roundtrips• # Requests increases Wait/Connect Time • Merge Resources • Use Spriting• Content Size increases Transfer/Wait Time • Minify Content • Compress Content • Payload vs. Markup
  • 26. Reduce Network Roundtrips• Merge Resources • Merge JavaScript and CSS Files • Use Sprites for Images -
  • 27. Reduce Network Roundtrips• Reduze Content Size • Optimize JavaScript Files -> • Use Styles in CSS files instead of inline Style definitions • Optimize CSS -> • „Smush“ Images ->
  • 28. Hands-On• Analyze Network Roundtrips
  • 29. Optimize JavaScript• JavaScript Engine is the new Client Application Runtime • Engines get better with every browser version• Similar problems as on Server-Side • Too many calls • Excessive String concatination • Memory Leaks
  • 30. Optimize JavaScript• Identify Long Running Event Handlers • Look at PurePaths with long JS Execution Time
  • 31. Optimize JavaScript• Identify Hotspot Methods • Use Hotspots View to identify long running and often called methods
  • 32. Optimize JavaScript – Analyze in AJAX Edition
  • 33. Hands-On• Analyze JavaScript Executions
  • 34. Optimize DOM Manipulations• DOM Changes allow dynamic modification of the page, e.g.: • Popup menus when moving the mouse over • Load additional content dynamically through AJAX and display • Highlight table rows you move the mouse over • Display input verification errors, e.g: incorrect phone number format• DOM Changes can be very costly as it requires the browser to • recalculate the layout information • Repaint the page
  • 35. Optimize DOM Manipulations• Analyze DOM Manipulations • Search for DOM Activities and backtrace to the caller • Drill to Browser PurePathSee who calls itFilter onDOM API
  • 36. Hands-On• Analyze DOM Manipulations
  • 37. Analyze external Content • Use Timeline to see download times of external content • Also analyze JavaScript executions of external content • Action: Delay Load external contentMore:
  • 38. Optimize AJAX Usage • AJAX is great to load dynamic content • Too many AJAX Calls put pressure on network and serverMore:
  • 39. Hands-On• Analyze usage of AJAX
  • 40. Analyze Rendering• Analyze Rendering Activities • There is expected rendering (drawing images, initial layouting, …) • There is dynamic rendering when modifying the DOM • Identify what triggers Rendering and where it happens
  • 41. Analyze Rendering• Rendering Hotspots • Which JavaScript/DOM Calls trigger Rendering activities
  • 42. Tips & Tricks• Clear Browser Cache when Testing Load Time • Different load behavior depending on Network Time• Test in different browsers • IE 6, 7 & 8 have different behavior • Use IE Compatibility Mode • Use WinXP Mode in Win7 or any other virtualized environment• Test from different Locations • to test sites from around the world (including dynaTrace Session Tracking)
  • 43. How to automate web performance• Integrate with your Testing Framework • Selenium, WebDriver, Silk, QTP, …• Browser Extensions record activity during test• Data can be sent to a result repository, e.g.:
  • 44. Analyze Performance across Builds
  • 45. Integrate into CI• Automate Alerting on Regressions
  • 46. Download the latest Application Performance almanac:Web | Cloud | DevOps | Mobile | Automation |
  • 47. Additional Resources• Steve Souders • • And his two books on Web Site Performance• Best Practices • • • s+on+Web+Site+Performance+Optimization• Blogs • • • – AJAX and Web 2.0 Tags