SlideShare a Scribd company logo
Patrick Hüsler, huesler informatik




   Client Side Optimization




Talked to several people, it is not entirely clear, what client side optimization actually ist
Listened to a marketing talk, people use one term and mean something completely different
define “Client Side
  Optimization”
Not about improving your customer
train him to perform better
and maybe add some cardio funk
So that you can turn this fellow into
Into this.
Although, if someone knows how to do this legally,
I’d love to hear that
Client ==
               Browser



Rails doesn’t scale
Performance
     ==
    Page
page_load.should
    be_fast
Measure and
 Analyze
Yahoo
YSlow
Google
 Page
Speed
YSlow Criteria
• Make fewer HTTP requests
• Use a Content Delivery Network
• Add Expires Headers
• Compress components with gzip
• Put CSS at top
• Put JavaScript at bottom
YSlow Criteria
• Avoid CSS expressions
• Make JavaScript and CSS external
• Reduce DNS lookups
• Minify JavaScript and CSS
• Avoid URL redirects
• Remove duplicate JavaScript and CSS
YSlow Criteria
• Configure entity tags (ETags)
• Make AJAX cacheable
• Use GET for AJAX requests
• Reduce the number of DOM elements
• Avoid HTTP 404 (Not found) error
• Reduce cookie size
YSlow Criteria

• Use cookie-free domains
• Avoid AlphaImageLoader filter
• Do not scale images in HTML
• Make favicon small and cacheable
Google “YSlow Rails”
       Copy
       Paste
        =>
      Done!!!
Google Driven
Development
Client Side Optimization
Increased User
  Experience

   >
Less data to

   <
Less connections
    to open
     <
Faster page load
Snappier UI
~=
Better user
experience
$$$
Less Bandwidth


    <
Less
Connections

   <
Less Server
   load

 ~<
~=
Save money
Focus
80/20
Focus
• Make fewer HTTP requests
• Parallel connections
• Add Expires Headers
• Compress components with gzip
• Minify assets
All with a little
help from Rails
AssetTagHelper
Combine
javascript_include_tag :all, :cache => true
stylesheet_link_tag :all, :cache => true
Parallelize
ActionController::Base.asset_host = Proc.new { |source|
  "http://assets#{rand(2) + 1}.example.com"
}
Add expires
 headers
Apache
<FilesMatch ".(ico|gif|jpe?g|png|js|css)$">
  ExpiresDefault "access plus 1 year"
</FilesMatch>
NGINX
server {
  location ~* .(ico|css|js|gif|jp?g|png)(?[0-9]+)?$ {
    expires max;
    break;
  }
}
Compress
contents
Apache
<directory "/Users/joe/work/cootweet/public">
Options -Indexes
        AddOutputFilterbyType DEFLATE text/
plain text/html text/css application/
javascript text/xml application/xml
application/xml+rss text/javascript
</directory>
NGINX
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/html text/css
application/x-javascript text/xml
application/xml application/xml+rss text/
javascript
CSS Sprites
#panel1b a:hover {
  background: transparent url(test-3.jpg)
  0 -200px no-repeat;}
#panel2b a:hover {
  background: transparent url(test-3.jpg)
  -96px -200px no-repeat;}
#panel3b a:hover {
  background: transparent url(test-3.jpg)
  -172px -200px no-repeat;}
#panel4b a:hover {
  background: transparent url(test-3.jpg)
  -283px -200px no-repeat;}
Minify Assets

• http://github.com/thumblemonks/smurf
• http://synthesis.sbecker.net/pages/
  asset_packager
Resources

• http://developer.yahoo.com/yslow/
• http://code.google.com/speed/page-speed/
• http://www.alistapart.com/articles/sprites
Thank You
•   patrick.huesler@googlemail.com

•   @phuesler

•   http://github.com/phuesler

•   http://www.huesler-informatik.ch/blog
Questions?
?   ? ? ?
  ?
?   ? ?
Thank You
•   patrick.huesler@googlemail.com

•   @phuesler

•   http://github.com/phuesler

•   http://www.huesler-informatik.ch/blog

More Related Content

PDF
Living on the Edge: Elevating your SEO toolkit to the CDN
KEY
Web Optimization Level: Paranoid
KEY
Optimizing Your Site
PDF
Browserscope oscon 2011
PDF
Consuming Web Services in Android
PDF
Improve Magento Performance
PPTX
Performance Metrics in a Day with Selenium
PDF
Scaling Marketplace to 10,000 Add-Ons - Arun Bhalla
Living on the Edge: Elevating your SEO toolkit to the CDN
Web Optimization Level: Paranoid
Optimizing Your Site
Browserscope oscon 2011
Consuming Web Services in Android
Improve Magento Performance
Performance Metrics in a Day with Selenium
Scaling Marketplace to 10,000 Add-Ons - Arun Bhalla

What's hot (20)

PPTX
Deploying a static website on Azure for $5 / month
PDF
AtlasCamp 2014: Static Connect Add-ons
PPTX
web optimizations
PDF
Automated Web App Performance Testing Using WebDriver
PPT
Go With The Reflow
PDF
Optimising the RSPB website (2011)
PDF
AtlasCamp 2014: Building a Production Ready Connect Add-on
PDF
UXify 2015 - Front-end Developers' Checklist for Better UX
PDF
Page experience road - WordCamp Athens 2022
PPTX
Automated Testing with Google Chrome - WebDriver- ChromeDriver
PPTX
DeepCrawl Webinar: Performing SEO on the Edge
PDF
Google Polymer Framework
PPT
Nodejs vs php_apache
PDF
Web Development with NodeJS
PPTX
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
PDF
Web performance testing with web driver
PPTX
Performance Web
PDF
Ng init | EPI Sousse
PPTX
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
PPTX
Level Up: 5 Expert Tips for Optimizing WordPress Performance
Deploying a static website on Azure for $5 / month
AtlasCamp 2014: Static Connect Add-ons
web optimizations
Automated Web App Performance Testing Using WebDriver
Go With The Reflow
Optimising the RSPB website (2011)
AtlasCamp 2014: Building a Production Ready Connect Add-on
UXify 2015 - Front-end Developers' Checklist for Better UX
Page experience road - WordCamp Athens 2022
Automated Testing with Google Chrome - WebDriver- ChromeDriver
DeepCrawl Webinar: Performing SEO on the Edge
Google Polymer Framework
Nodejs vs php_apache
Web Development with NodeJS
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
Web performance testing with web driver
Performance Web
Ng init | EPI Sousse
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Level Up: 5 Expert Tips for Optimizing WordPress Performance
Ad

Viewers also liked (20)

PDF
Online Presence Management
PDF
Tim web presentation 3 q12-eng
PDF
Wachovia wells fargo
PDF
Actiance whitepaper-social-media-legal-issues-canada
PPT
Ugsolar太阳能
PDF
3Q14 Results Presentation
PDF
Meeting with Investors - May 2014
PDF
Webcast 3Q10
PDF
Results Presentation 3Q15
PDF
GroupL FZE Brochure
PPT
Indigo hotel presentation 07 27-2010
PDF
Small Cocoa Apps with MacRuby
PPTX
2014 state of arts humanities montgomery county final
PPTX
Project Zero marks and indices
PDF
Trial Sbp 2006 Mm1
PDF
Tim meeting with investors - agosto 2014
PPTX
Vooruitblik petrol 2011
PPTX
The power of social media uwo
PDF
Taqwim smk landas 2011
PDF
I Mostra Municipal de Humanização na Saúde
Online Presence Management
Tim web presentation 3 q12-eng
Wachovia wells fargo
Actiance whitepaper-social-media-legal-issues-canada
Ugsolar太阳能
3Q14 Results Presentation
Meeting with Investors - May 2014
Webcast 3Q10
Results Presentation 3Q15
GroupL FZE Brochure
Indigo hotel presentation 07 27-2010
Small Cocoa Apps with MacRuby
2014 state of arts humanities montgomery county final
Project Zero marks and indices
Trial Sbp 2006 Mm1
Tim meeting with investors - agosto 2014
Vooruitblik petrol 2011
The power of social media uwo
Taqwim smk landas 2011
I Mostra Municipal de Humanização na Saúde
Ad

Similar to Client Side Optimization (20)

PDF
High Performance Ajax Applications
PPTX
The Need for Speed - SMX Sydney 2013
PDF
GR8Conf 2011: Building Progressive UIs with Grails
PPT
Frontend performance
PDF
Ajax Performance Tuning and Best Practices
PPT
High Performance Web Pages - 20 new best practices
KEY
HTML5 Hacking - Yahoo! Open Hack Day
PDF
Developing High Performance Web Apps
PDF
High performance website
KEY
Developing High Performance Web Apps - CodeMash 2011
PPTX
Harder, Better, Faster, Stronger
PDF
Magento Performance Optimization 101
PDF
Build Better Responsive websites. Hrvoje Jurišić
PPTX
High-Speed HTML5
PPTX
Building Faster Websites
PPTX
Enough with the JavaScript already!
PPTX
Html 5
PPTX
Enough with the javas cript already! de Nicholas Zakas
PPTX
10 things you can do to speed up your web app today stir trek edition
PPT
Please dont touch-3.6-jsday
High Performance Ajax Applications
The Need for Speed - SMX Sydney 2013
GR8Conf 2011: Building Progressive UIs with Grails
Frontend performance
Ajax Performance Tuning and Best Practices
High Performance Web Pages - 20 new best practices
HTML5 Hacking - Yahoo! Open Hack Day
Developing High Performance Web Apps
High performance website
Developing High Performance Web Apps - CodeMash 2011
Harder, Better, Faster, Stronger
Magento Performance Optimization 101
Build Better Responsive websites. Hrvoje Jurišić
High-Speed HTML5
Building Faster Websites
Enough with the JavaScript already!
Html 5
Enough with the javas cript already! de Nicholas Zakas
10 things you can do to speed up your web app today stir trek edition
Please dont touch-3.6-jsday

More from Patrick Huesler (8)

PDF
Technical Challenges of Developing a Facebook Game
PDF
Culerity and Headless Full Stack Integration Testing
PDF
Building and deploying Cocoa applications with ChocTop
PDF
Choctop Lightning talk EuRuKo 2010
PDF
Fun with Ruby and Cocoa
PDF
Erlang, an overview
PDF
Migrating legacy data
PDF
Active Record No No's
Technical Challenges of Developing a Facebook Game
Culerity and Headless Full Stack Integration Testing
Building and deploying Cocoa applications with ChocTop
Choctop Lightning talk EuRuKo 2010
Fun with Ruby and Cocoa
Erlang, an overview
Migrating legacy data
Active Record No No's

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Big Data Technologies - Introduction.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Electronic commerce courselecture one. Pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Review of recent advances in non-invasive hemoglobin estimation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
MYSQL Presentation for SQL database connectivity
Big Data Technologies - Introduction.pptx
Unlocking AI with Model Context Protocol (MCP)
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Spectroscopy.pptx food analysis technology
Understanding_Digital_Forensics_Presentation.pptx
Network Security Unit 5.pdf for BCA BBA.
Advanced methodologies resolving dimensionality complications for autism neur...
Digital-Transformation-Roadmap-for-Companies.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
sap open course for s4hana steps from ECC to s4
Electronic commerce courselecture one. Pdf
Programs and apps: productivity, graphics, security and other tools
Chapter 3 Spatial Domain Image Processing.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Review of recent advances in non-invasive hemoglobin estimation

Client Side Optimization