SlideShare uma empresa Scribd logo
1 de 42
Baixar para ler offline
Front
   End
Performance
              Konstantin
              Käfer
What’s Performance?


                  Loading


     Perception             Measurement


                   Using


2                                     Konstantin Käfer
Styles, scripts and images
            account for
     over 80% of load time.


3                          Konstantin Käfer
Back-             Other
    grounds   Images   Media



     HTML      CSS     Scripts




4                                Konstantin Käfer
Distribution (time)

                                              Images
     HTML


                                     Back-
                CSS       Scripts   grounds     +
                                               Media


            Time spent generating
              the page in Drupal




5                                                Konstantin Käfer
Overall load time?



6                        Konstantin Käfer
Page size?



7                Konstantin Käfer
Time until DOM is loaded?



8                           Konstantin Käfer
Time until page is rendered?



9                             Konstantin Käfer
Time until page
      is functional?



10                     Konstantin Käfer
Render a usable version
       as early as possible.



11                             Konstantin Käfer
1   Introduction ✔

     2   Tools & Measurement

     3   Speed optimization

     4   Beyond YSlow


12                             Konstantin Käfer
Measure to prove
     optimization success.



13                           Konstantin Käfer
Firebug’s Net panel




14                         Konstantin Käfer
YSlow
     ‣   Rates a webpage based on 13 criteria
     ‣   Determines overall load time
     ‣   Provides optimization suggestions
     ‣   Graphs, Numbers & Figures




15                                              Konstantin Käfer
YSlow




16           Konstantin Käfer
YSlow is not everything.



17                              Konstantin Käfer
Episodes
     ‣   Measure timing for Web 2.0 applications
     ‣   More granular measurement
     ‣   Drupal module!
         http://drupal.org/project/episodes




18                                                 Konstantin Käfer
Other tools
     ‣   AOL Page Test
         online version: http://webpagetest.org
     ‣   IBM Page Detailer
         http://www.alphaworks.ibm.com/tech/pagedetailer
     ‣   Pingdom
         http://tools.pingdom.com
     ‣   WebKit’s Web Inspector
         Safari 4 Beta or WebKit nightly from http://webkit.org
     ‣   Web Debugging Proxies
         http://charlesproxy.com, http://fiddlertool.com
19                                                           Konstantin Käfer
Waterfall diagrams




     Start   Connect   First byte   Last byte
20                                     Konstantin Käfer
1   Introduction ✔

     2   Tools & Measurement ✔

     3   Speed optimization

     4   Beyond YSlow


21                               Konstantin Käfer
1. Reduce requests
     ‣   Every file produces an HTTP request
          60s

          45s

          30s                              Requests
                                           Size
          15s

           0s
                0   10     20     30


     ‣   Fewer requests is better than smaller size
     ‣   HTTP 1.1: 2 components per host in parallel
22                                                     Konstantin Käfer
1. Reduce requests
     ‣   Sprites
         – Many images into one file
         – Shift into view with background-position
     ‣   Aggregate scripts and styles
         – Built into Drupal
         – Sophisticated: http://drupal.org/project/sf_cache
     ‣   No redirects

23                                                             Konstantin Käfer
1. Reduce requests
     ‣   Caching (see 3.)
     ‣   Use CSS instead of images
             -moz-border-radius:4px;
             -webkit-border-radius: 4px;
             border-radius: 4px;

     ‣   data: URLs in style sheets
         –    url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAGXRFWHRTb2Z
             0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAR9JREFUeNrEk02ORUAUhRVNJEgYsgdGbIHFsSGmhhjZAzFCR
             CLx906io3UROu8N+g7vPR9V95wi67oy79bXuTXP8zAMfdP48jzvCRJoihyHPcA4xRd1+V5HoZhmqZ1XWuaZ
             tu267qWZSmKQghhKGCrZVmqqgqCQNd16g/ooI8pNOuhfuC2bX3fFwTh8nroYwrNBTxNUxzHhmHcrAf/hwb
             KHWa3ATYURVFRFDdwWZbYBZR75xvGbpMkefQmyzIoaRiuNE3zCGP/UNIw/FRV9RGGBkoaRhLg5yPsOA6U
             tM/vbfuXz0jCjc+YXvu8JwxJOCcMJ9oShtgfYXJ8VedsY0O4p+d5pmnKssyy7PGj5Pwk//6qyCfvmWU+qP+DXw
             IMADReKA+zC0X8AAAAAElFTkSuQmCC);



24                                                                                         Konstantin Käfer
2. Use a CDN
     ‣   Content Delivery Network
     ‣   Lots of servers scattered around the world
     ‣   Reduces roundtrip times (ping)
     ‣   Comparably cheap: $0.07 - $0.80 per GB
         –   http://www.simplecdn.com
         –   http://pantherexpress.com
         –   http://cachefly.com
         –   http://aws.amazon.com/cloudfront
         –   http://www.limelightnetworks.com
         –   http://www.akamai.com
25                                                    Konstantin Käfer
Round Trip Time
     ‣   HTTP is usually done over TCP/IP
     ‣   Stateful: Three Way Handshakes
     ‣   Round trip time (ping) has high effect

                              Request

               Client                       Server

                               Response

26                                                   Konstantin Käfer
3. Caching
                             ?
     Disabled:     Client                    Server
                    Cache

                                        Full response
                             ?
      Default:     Client                    Server
                            “Still fresh”
                    Cache
                                      Partial response

     Aggressive:   Client                    Server
                    Cache
27                                                Konstantin Käfer
3. Caching
     ‣   Controlled by HTTP headers
     ‣   Browsers check whether content is fresh
     ‣   Set Expires header to a date in the far future
         – <Location /css>
           	 ExpiresActive On
           	 ExpiresDefault quot;access plus 1 yearquot;
           </Location>


     ‣   Change filenames/URLs when updating



28                                                   Konstantin Käfer
4. GZip
     ‣   Compress text content (don’t use for images!)
         – <IfModule mod_deflate.c>
           	 AddOutputFilterByType DEFLATE text/css application/x-javascript
           </IfModule>


     ‣   Vastly reduces page size
     ‣   NowPublic.com: 700 KB ➔ 300 KB
     ‣   Compress scripts and styles as well



29                                                                   Konstantin Käfer
5. CSS to the top
     ‣   == in <head>
     ‣   Page renders when all header CSS is loaded
     ‣   Loading CSS later causes re-rendering and
         Flash of Unstyled Content
     ‣   Use <link> instead of @import
         http://www.stevesouders.com/blog/2009/04/09/dont-use-import/




30                                                                      Konstantin Käfer
31                                               Konstantin Käfer




     ‣   == right before </body>
     ‣   Loading scripts blocks page rendering
     ‣   Scripts are loaded sequentially!
         (At least in most current browsers)

     ‣   Don’t use onfoo handlers in HTML code
     ‣   Graceful degradation


     6. Scripts to the bottom
7. Minify CSS and JS
     ‣   Remove comments and whitespace
     ‣   Still savings, even with GZip
     ‣   Drupal’s aggregator or sf_cache.module




32                                                Konstantin Käfer
1   Introduction ✔

     2   Tools & Measurement ✔

     3   Speed optimization ✔

     4   Beyond YSlow


33                               Konstantin Käfer
8. Parallelization
     ‣   RFC: 2 requests per host name in parallel
     ‣   Use multiple host names ➔ higher
         parallelization
         (Don’t overdo it)
     ‣   Most current browsers use > 2 connections
     ‣   http://stevesouders.com/ua/




34                                                   Konstantin Käfer
HTTP connections
     ‣   “A single-user client SHOULD NOT maintain
         more than 2 connections with any server
         or proxy.” (RFC 2616, 8.1.4)




35
                   1    2    3    4    5      Konstantin Käfer
9. Reduce image weight
     ‣   OptiPNG, PNGCrush, ...
         – Removes invisible content
         – Lossless recompression
         –   for i in `find . -name quot;*.pngquot;` ; do optipng -o7 $i ; done


     ‣   JPEGtran/ImageMagick
         – Remove color profiles, meta data, …
         – Lossless JPEG operations
     ‣   http://smushit.com – now integrated into YSlow
36                                                                 Konstantin Käfer
10. Persistent HTTP
     ‣   HTTP supports persistent connections
             multiple connections      persistent connection
                 client   server       client       server
         open                       open



         close
         open




                                                             time
         close
         open
                                    close


         close




     ‣   Make sure KeepAlive is not turned off
37                                                                  Konstantin Käfer
10. Persistent HTTP
     ‣   AOL Pagetest has connection view




38                                          Konstantin Käfer
11. Lazy initialization
     ‣   JavaScript takes time to initialize
         – Libraries such as jQuery also count
         – Defer setup work
     ‣   Only load content above the fold
         – jQuery plugin: http://bit.ly/NpZPn
         – Useful on image-heavy sites




39                                               Konstantin Käfer
12. Other optimizations
     ‣   “Premature optimization is the root of all evil”
                                                    —Donald Knuth

     ‣   Only if you have optimized everything else

     ‣   Strategies
         – Move components to cookieless host
         – Remove ETags
         – Load order (see http://stevesouders.com/cuzillion/)


40                                                           Konstantin Käfer
Thanks! Questions?



        Konstantin Käfer
          mail@kkaefer.com




41                           Konstantin Käfer
Ressources
     – High Performance Websites, Steve Souders, 2007.
     – http://stevesouders.com/examples/rules.php
     – http://developer.yahoo.com/performance/
     – http://yuiblog.com/blog/category/performance
     – http://sites.google.com/site/io/even-faster-web-sites
     – http://slideshare.net/jeresig/performance-improvements-
       in-browsers
     – http://www.stevesouders.com/blog/2009/04/09/dont-
       use-import/
42                                                             Konstantin Käfer

Mais conteúdo relacionado

Mais procurados

Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)Ontico
 
Apache httpd 2.4: The Cloud Killer App
Apache httpd 2.4: The Cloud Killer AppApache httpd 2.4: The Cloud Killer App
Apache httpd 2.4: The Cloud Killer AppJim Jagielski
 
Australian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStackAustralian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStackMatt Ray
 
Nginx - Tips and Tricks.
Nginx - Tips and Tricks.Nginx - Tips and Tricks.
Nginx - Tips and Tricks.Harish S
 
Learn nginx in 90mins
Learn nginx in 90minsLearn nginx in 90mins
Learn nginx in 90minsLarry Cai
 
Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by StepKim Stefan Lindholm
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeMichael May
 
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE
 
Load Balancing Applications with NGINX in a CoreOS Cluster
Load Balancing Applications with NGINX in a CoreOS ClusterLoad Balancing Applications with NGINX in a CoreOS Cluster
Load Balancing Applications with NGINX in a CoreOS ClusterKevin Jones
 
5 things you didn't know nginx could do velocity
5 things you didn't know nginx could do   velocity5 things you didn't know nginx could do   velocity
5 things you didn't know nginx could do velocitysarahnovotny
 
Using NGINX as an Effective and Highly Available Content Cache
Using NGINX as an Effective and Highly Available Content CacheUsing NGINX as an Effective and Highly Available Content Cache
Using NGINX as an Effective and Highly Available Content CacheKevin Jones
 
NGINX 101 - now with more Docker
NGINX 101 - now with more DockerNGINX 101 - now with more Docker
NGINX 101 - now with more DockerSarah Novotny
 
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex Lau
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex LauDoing QoS Before Ceph Cluster QoS is available - David Byte, Alex Lau
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex LauCeph Community
 
Automatic Operation Bot for Ceph - You Ji
Automatic Operation Bot for Ceph - You JiAutomatic Operation Bot for Ceph - You Ji
Automatic Operation Bot for Ceph - You JiCeph Community
 
under the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or lessunder the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or lesssarahnovotny
 
Caching with varnish
Caching with varnishCaching with varnish
Caching with varnish90kts
 

Mais procurados (19)

Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
 
Apache httpd 2.4: The Cloud Killer App
Apache httpd 2.4: The Cloud Killer AppApache httpd 2.4: The Cloud Killer App
Apache httpd 2.4: The Cloud Killer App
 
Australian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStackAustralian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStack
 
Nginx - Tips and Tricks.
Nginx - Tips and Tricks.Nginx - Tips and Tricks.
Nginx - Tips and Tricks.
 
Learn nginx in 90mins
Learn nginx in 90minsLearn nginx in 90mins
Learn nginx in 90mins
 
How to monitor NGINX
How to monitor NGINXHow to monitor NGINX
How to monitor NGINX
 
Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by Step
 
Oscon 2010 - ATS
Oscon 2010 - ATSOscon 2010 - ATS
Oscon 2010 - ATS
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the Edge
 
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
 
Load Balancing Applications with NGINX in a CoreOS Cluster
Load Balancing Applications with NGINX in a CoreOS ClusterLoad Balancing Applications with NGINX in a CoreOS Cluster
Load Balancing Applications with NGINX in a CoreOS Cluster
 
5 things you didn't know nginx could do velocity
5 things you didn't know nginx could do   velocity5 things you didn't know nginx could do   velocity
5 things you didn't know nginx could do velocity
 
Using NGINX as an Effective and Highly Available Content Cache
Using NGINX as an Effective and Highly Available Content CacheUsing NGINX as an Effective and Highly Available Content Cache
Using NGINX as an Effective and Highly Available Content Cache
 
NGINX 101 - now with more Docker
NGINX 101 - now with more DockerNGINX 101 - now with more Docker
NGINX 101 - now with more Docker
 
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex Lau
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex LauDoing QoS Before Ceph Cluster QoS is available - David Byte, Alex Lau
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex Lau
 
Automatic Operation Bot for Ceph - You Ji
Automatic Operation Bot for Ceph - You JiAutomatic Operation Bot for Ceph - You Ji
Automatic Operation Bot for Ceph - You Ji
 
ReplacingSquidWithATS
ReplacingSquidWithATSReplacingSquidWithATS
ReplacingSquidWithATS
 
under the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or lessunder the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or less
 
Caching with varnish
Caching with varnishCaching with varnish
Caching with varnish
 

Semelhante a Front End Performance

What's New in Web Development
What's New in Web DevelopmentWhat's New in Web Development
What's New in Web DevelopmentKonstantin Käfer
 
From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Clusterguestd34230
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfcodearachnid_test
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfcodearachnid_test
 
Page Performance
Page PerformancePage Performance
Page Performanceatorreno
 
ASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen OxfordASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen OxfordPhil Pursglove
 
WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningTimothy Wood
 
High performance website
High performance websiteHigh performance website
High performance websiteChamnap Chhorn
 
ASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDPhil Pursglove
 
WordPress performance tuning
WordPress performance tuningWordPress performance tuning
WordPress performance tuningVladimír Smitka
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonPhil Pursglove
 
Kubernetes & Google Container Engine @ mabl
Kubernetes & Google Container Engine @ mablKubernetes & Google Container Engine @ mabl
Kubernetes & Google Container Engine @ mablJoseph Lust
 
Extending Your Applications to the Edge with CDNs
Extending Your Applications to the Edge with CDNsExtending Your Applications to the Edge with CDNs
Extending Your Applications to the Edge with CDNsSalesforce Developers
 

Semelhante a Front End Performance (20)

Front End Performance
Front End PerformanceFront End Performance
Front End Performance
 
What's New in Web Development
What's New in Web DevelopmentWhat's New in Web Development
What's New in Web Development
 
From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Cluster
 
#Webperf Choreography
#Webperf Choreography#Webperf Choreography
#Webperf Choreography
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdf
 
WordCamp RVA
WordCamp RVAWordCamp RVA
WordCamp RVA
 
WordCamp RVA
WordCamp RVAWordCamp RVA
WordCamp RVA
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdf
 
Capistrano
CapistranoCapistrano
Capistrano
 
Page Performance
Page PerformancePage Performance
Page Performance
 
ASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen OxfordASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen Oxford
 
WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & Tuning
 
High performance website
High performance websiteHigh performance website
High performance website
 
ASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDASP.NET Scalability - WebDD
ASP.NET Scalability - WebDD
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
Http2 in practice
Http2 in practiceHttp2 in practice
Http2 in practice
 
WordPress performance tuning
WordPress performance tuningWordPress performance tuning
WordPress performance tuning
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG London
 
Kubernetes & Google Container Engine @ mabl
Kubernetes & Google Container Engine @ mablKubernetes & Google Container Engine @ mabl
Kubernetes & Google Container Engine @ mabl
 
Extending Your Applications to the Edge with CDNs
Extending Your Applications to the Edge with CDNsExtending Your Applications to the Edge with CDNs
Extending Your Applications to the Edge with CDNs
 

Último

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
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
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 

Último (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 
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...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 

Front End Performance

  • 1. Front End Performance Konstantin Käfer
  • 2. What’s Performance? Loading Perception Measurement Using 2 Konstantin Käfer
  • 3. Styles, scripts and images account for over 80% of load time. 3 Konstantin Käfer
  • 4. Back- Other grounds Images Media HTML CSS Scripts 4 Konstantin Käfer
  • 5. Distribution (time) Images HTML Back- CSS Scripts grounds + Media Time spent generating the page in Drupal 5 Konstantin Käfer
  • 6. Overall load time? 6 Konstantin Käfer
  • 7. Page size? 7 Konstantin Käfer
  • 8. Time until DOM is loaded? 8 Konstantin Käfer
  • 9. Time until page is rendered? 9 Konstantin Käfer
  • 10. Time until page is functional? 10 Konstantin Käfer
  • 11. Render a usable version as early as possible. 11 Konstantin Käfer
  • 12. 1 Introduction ✔ 2 Tools & Measurement 3 Speed optimization 4 Beyond YSlow 12 Konstantin Käfer
  • 13. Measure to prove optimization success. 13 Konstantin Käfer
  • 14. Firebug’s Net panel 14 Konstantin Käfer
  • 15. YSlow ‣ Rates a webpage based on 13 criteria ‣ Determines overall load time ‣ Provides optimization suggestions ‣ Graphs, Numbers & Figures 15 Konstantin Käfer
  • 16. YSlow 16 Konstantin Käfer
  • 17. YSlow is not everything. 17 Konstantin Käfer
  • 18. Episodes ‣ Measure timing for Web 2.0 applications ‣ More granular measurement ‣ Drupal module! http://drupal.org/project/episodes 18 Konstantin Käfer
  • 19. Other tools ‣ AOL Page Test online version: http://webpagetest.org ‣ IBM Page Detailer http://www.alphaworks.ibm.com/tech/pagedetailer ‣ Pingdom http://tools.pingdom.com ‣ WebKit’s Web Inspector Safari 4 Beta or WebKit nightly from http://webkit.org ‣ Web Debugging Proxies http://charlesproxy.com, http://fiddlertool.com 19 Konstantin Käfer
  • 20. Waterfall diagrams Start Connect First byte Last byte 20 Konstantin Käfer
  • 21. 1 Introduction ✔ 2 Tools & Measurement ✔ 3 Speed optimization 4 Beyond YSlow 21 Konstantin Käfer
  • 22. 1. Reduce requests ‣ Every file produces an HTTP request 60s 45s 30s Requests Size 15s 0s 0 10 20 30 ‣ Fewer requests is better than smaller size ‣ HTTP 1.1: 2 components per host in parallel 22 Konstantin Käfer
  • 23. 1. Reduce requests ‣ Sprites – Many images into one file – Shift into view with background-position ‣ Aggregate scripts and styles – Built into Drupal – Sophisticated: http://drupal.org/project/sf_cache ‣ No redirects 23 Konstantin Käfer
  • 24. 1. Reduce requests ‣ Caching (see 3.) ‣ Use CSS instead of images -moz-border-radius:4px; -webkit-border-radius: 4px; border-radius: 4px; ‣ data: URLs in style sheets – url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAGXRFWHRTb2Z 0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAR9JREFUeNrEk02ORUAUhRVNJEgYsgdGbIHFsSGmhhjZAzFCR CLx906io3UROu8N+g7vPR9V95wi67oy79bXuTXP8zAMfdP48jzvCRJoihyHPcA4xRd1+V5HoZhmqZ1XWuaZ tu267qWZSmKQghhKGCrZVmqqgqCQNd16g/ooI8pNOuhfuC2bX3fFwTh8nroYwrNBTxNUxzHhmHcrAf/hwb KHWa3ATYURVFRFDdwWZbYBZR75xvGbpMkefQmyzIoaRiuNE3zCGP/UNIw/FRV9RGGBkoaRhLg5yPsOA6U tM/vbfuXz0jCjc+YXvu8JwxJOCcMJ9oShtgfYXJ8VedsY0O4p+d5pmnKssyy7PGj5Pwk//6qyCfvmWU+qP+DXw IMADReKA+zC0X8AAAAAElFTkSuQmCC); 24 Konstantin Käfer
  • 25. 2. Use a CDN ‣ Content Delivery Network ‣ Lots of servers scattered around the world ‣ Reduces roundtrip times (ping) ‣ Comparably cheap: $0.07 - $0.80 per GB – http://www.simplecdn.com – http://pantherexpress.com – http://cachefly.com – http://aws.amazon.com/cloudfront – http://www.limelightnetworks.com – http://www.akamai.com 25 Konstantin Käfer
  • 26. Round Trip Time ‣ HTTP is usually done over TCP/IP ‣ Stateful: Three Way Handshakes ‣ Round trip time (ping) has high effect Request Client Server Response 26 Konstantin Käfer
  • 27. 3. Caching ? Disabled: Client Server Cache Full response ? Default: Client Server “Still fresh” Cache Partial response Aggressive: Client Server Cache 27 Konstantin Käfer
  • 28. 3. Caching ‣ Controlled by HTTP headers ‣ Browsers check whether content is fresh ‣ Set Expires header to a date in the far future – <Location /css> ExpiresActive On ExpiresDefault quot;access plus 1 yearquot; </Location> ‣ Change filenames/URLs when updating 28 Konstantin Käfer
  • 29. 4. GZip ‣ Compress text content (don’t use for images!) – <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/css application/x-javascript </IfModule> ‣ Vastly reduces page size ‣ NowPublic.com: 700 KB ➔ 300 KB ‣ Compress scripts and styles as well 29 Konstantin Käfer
  • 30. 5. CSS to the top ‣ == in <head> ‣ Page renders when all header CSS is loaded ‣ Loading CSS later causes re-rendering and Flash of Unstyled Content ‣ Use <link> instead of @import http://www.stevesouders.com/blog/2009/04/09/dont-use-import/ 30 Konstantin Käfer
  • 31. 31 Konstantin Käfer ‣ == right before </body> ‣ Loading scripts blocks page rendering ‣ Scripts are loaded sequentially! (At least in most current browsers) ‣ Don’t use onfoo handlers in HTML code ‣ Graceful degradation 6. Scripts to the bottom
  • 32. 7. Minify CSS and JS ‣ Remove comments and whitespace ‣ Still savings, even with GZip ‣ Drupal’s aggregator or sf_cache.module 32 Konstantin Käfer
  • 33. 1 Introduction ✔ 2 Tools & Measurement ✔ 3 Speed optimization ✔ 4 Beyond YSlow 33 Konstantin Käfer
  • 34. 8. Parallelization ‣ RFC: 2 requests per host name in parallel ‣ Use multiple host names ➔ higher parallelization (Don’t overdo it) ‣ Most current browsers use > 2 connections ‣ http://stevesouders.com/ua/ 34 Konstantin Käfer
  • 35. HTTP connections ‣ “A single-user client SHOULD NOT maintain more than 2 connections with any server or proxy.” (RFC 2616, 8.1.4) 35 1 2 3 4 5 Konstantin Käfer
  • 36. 9. Reduce image weight ‣ OptiPNG, PNGCrush, ... – Removes invisible content – Lossless recompression – for i in `find . -name quot;*.pngquot;` ; do optipng -o7 $i ; done ‣ JPEGtran/ImageMagick – Remove color profiles, meta data, … – Lossless JPEG operations ‣ http://smushit.com – now integrated into YSlow 36 Konstantin Käfer
  • 37. 10. Persistent HTTP ‣ HTTP supports persistent connections multiple connections persistent connection client server client server open open close open time close open close close ‣ Make sure KeepAlive is not turned off 37 Konstantin Käfer
  • 38. 10. Persistent HTTP ‣ AOL Pagetest has connection view 38 Konstantin Käfer
  • 39. 11. Lazy initialization ‣ JavaScript takes time to initialize – Libraries such as jQuery also count – Defer setup work ‣ Only load content above the fold – jQuery plugin: http://bit.ly/NpZPn – Useful on image-heavy sites 39 Konstantin Käfer
  • 40. 12. Other optimizations ‣ “Premature optimization is the root of all evil” —Donald Knuth ‣ Only if you have optimized everything else ‣ Strategies – Move components to cookieless host – Remove ETags – Load order (see http://stevesouders.com/cuzillion/) 40 Konstantin Käfer
  • 41. Thanks! Questions? Konstantin Käfer mail@kkaefer.com 41 Konstantin Käfer
  • 42. Ressources – High Performance Websites, Steve Souders, 2007. – http://stevesouders.com/examples/rules.php – http://developer.yahoo.com/performance/ – http://yuiblog.com/blog/category/performance – http://sites.google.com/site/io/even-faster-web-sites – http://slideshare.net/jeresig/performance-improvements- in-browsers – http://www.stevesouders.com/blog/2009/04/09/dont- use-import/ 42 Konstantin Käfer