SlideShare uma empresa Scribd logo
1 de 62
Baixar para ler offline
Webcat October ’12


#webcat / @abellonch

                       1
Web performance
  optimization
for everyone



                  2
Albert Bellonch

          CTO

          @abellonch

          /albertbellonch

          albert@itnig.net

                             3
What’s WPO?
Web performance optimization is the process by which
   individual aspects of web pages are optimized,
  in order to achieve greater overall performance




                                                       4
What’s WPO?
Web performance optimization is the process by which
   individual aspects of web pages are optimized,
  in order to achieve greater overall performance

             “Make it faster”




                                                       4
Advantages

•Less server load
•Better SEO
•Better user experience




                          5
What’s in a web page?




                        6
What’s in a web page?



  HTML markup




                        6
What’s in a web page?
                    CSS stylesheets




  HTML markup




                                      6
What’s in a web page?
                    CSS stylesheets

                        Javascript code


  HTML markup




                                          6
What’s in a web page?
                    CSS stylesheets

                        Javascript code


  HTML markup           Images




                                          6
What’s in a web page?
                    CSS stylesheets

                        Javascript code


  HTML markup           Images

                        Fonts



                                          6
What’s in a web page?
                    CSS stylesheets

                        Javascript code


  HTML markup           Images

                        Fonts

                        much more

                                          6
WPO Techniques




                 7
Request combination




                      8
Typical scenario A wine store


  Browser                       Server




                                         9
Typical scenario A wine store
                 Home page CSS




  Browser                        Server




                                          9
Typical scenario A wine store
                 Home page CSS



                  Wine list CSS

  Browser                         Server




                                           9
Typical scenario A wine store
                 Home page CSS



                  Wine list CSS

  Browser                           Server
                 Wine details CSS




                                             9
Typical scenario A wine store
                 Home page CSS



                   Wine list CSS

  Browser                            Server
                 Wine details CSS


                  ...more CSS files




                                              9
Combine it!
In HTTP requests, a considerable amount of time is used when asking
     for the information, instead of transmitting this information.




                                                                      10
The lazy-boy-in-the-sofa example




                                   11
Improved scenario A wine store


               All CSS files combined
  Browser                              Server




                                                12
Same for Javascript
Appliable with images: sprites




                                 13
Can we do it better?




                       14
Can we do it better?
      Yes!



                       14
Resource minification




                       15
Typical scenario Uncompressed CSS (~56KB)




                                            16
Minify it!
                 Send only the essential information.
This way, less data is sent, and thus less time is spent transferring it.




                                                                            17
The gibberish-conversation example




                                     18
Improved scenario Compressed CSS (~25KB)




                                       19
Similar for Javascript
More complex with images




                           20
Can we do it better?




                       21
Can we do it better?
      Yes!



                       21
Image optimization




                     22
Typical scenario Unscaled picture



    30 KB




                                    23
Typical scenario Unscaled picture
                                      150 KB


30 KB




              But the real image is

                                               23
Slim down the images!
The images should have the same size as they are shown as,
              and should be optimized too.




                                                             24
The gigantic-field example




                            25
Improved scenario Scaled picture



    30 KB




                                   26
Improved scenario Scaled picture



 30 KB                                 30 KB




                        And the real image is

                                                26
Can we do it better?




                       27
Can we do it better?
      Yes!



                       27
Caching




          28
Typical scenario A wine store, again


  Browser                              Server




                                                29
Typical scenario A wine store, again
               Picture of 1787’ Chateau d’Yquern




  Browser                                          Server




                                                            29
Typical scenario A wine store, again
               Picture of 1787’ Chateau d’Yquern



               Picture of 1787’ Chateau d’Yquern

  Browser                                          Server




                                                            29
Typical scenario A wine store, again
               Picture of 1787’ Chateau d’Yquern



               Picture of 1787’ Chateau d’Yquern

  Browser                                          Server
               Picture of 1787’ Chateau d’Yquern




                                                            29
Typical scenario A wine store, again
               Picture of 1787’ Chateau d’Yquern



               Picture of 1787’ Chateau d’Yquern

  Browser                                          Server
               Picture of 1787’ Chateau d’Yquern


               Picture of 1787’ Chateau d’Yquern




                                                            29
Ask only missing stuff!
If you know something won’t change for some time,
            don’t ask for it until it does.




                                                    30
The I-wanna-know example




                           31
Improved scenario A wine store, again


  Browser                           Server




                                             32
Improved scenario A wine store, again
              Picture of 1787’ Chateau d’Yquern




  Browser                                         Server




                                                           32
Improved scenario A wine store, again
                      Picture of 1787’ Chateau d’Yquern




            OK, I have the picture of 1787’ Chateau       Server
  Browser
            d’Yquern, so I’ll show it directly.




                                                                   32
Can we do it better?




                       33
Can we do it better?
      Yes!



                       33
Other techniques




                   34
Use GET in Ajax requests   Expiration headers
Use JSON in AJAX requests Reduce use of CNAME
Reduce DOM elements        JPEG and PNG codification
Reduce iframes             Lazy load for images
Prefer CSS over JS         Content Delivery Networks
Activate deflate            Avoid Flash files
Font optimizing            Eager loading
Cache Control headers      Mobile-specific optimisations


                                                          35
No time for much more...




                           36
Be careful!

•There’s a lot of things to do
•Pick your critical weaknesses, and solve them first
•Go step by step
•Have your timing and resources into account




                                                      37
Questions?
I can’t bite you from this far!




                                  38
Thank you!




             39

Mais conteúdo relacionado

Mais de webcat

Mais de webcat (20)

"Demystifying development techniques" por @eturino
"Demystifying development techniques" por @eturino"Demystifying development techniques" por @eturino
"Demystifying development techniques" por @eturino
 
"Inception" por @CarlosTheSailor
"Inception" por @CarlosTheSailor"Inception" por @CarlosTheSailor
"Inception" por @CarlosTheSailor
 
"Cómo hicimos la web responsive y accesible de cierto equipo de fútbol y otro...
"Cómo hicimos la web responsive y accesible de cierto equipo de fútbol y otro..."Cómo hicimos la web responsive y accesible de cierto equipo de fútbol y otro...
"Cómo hicimos la web responsive y accesible de cierto equipo de fútbol y otro...
 
"unoStringSynth: hack musical con Arduino" por @unoStringSynth
"unoStringSynth: hack musical con Arduino" por @unoStringSynth"unoStringSynth: hack musical con Arduino" por @unoStringSynth
"unoStringSynth: hack musical con Arduino" por @unoStringSynth
 
"UX en 10 películas" por @nunile
"UX en 10 películas" por @nunile"UX en 10 películas" por @nunile
"UX en 10 películas" por @nunile
 
"Continuous Deployment" por @fredfigueiredo
"Continuous Deployment" por @fredfigueiredo"Continuous Deployment" por @fredfigueiredo
"Continuous Deployment" por @fredfigueiredo
 
"WebView, the fifth element" por @fernando_cejas
"WebView, the fifth element" por @fernando_cejas"WebView, the fifth element" por @fernando_cejas
"WebView, the fifth element" por @fernando_cejas
 
"Pushing the boundaries" por @danielguillan
"Pushing the boundaries" por @danielguillan"Pushing the boundaries" por @danielguillan
"Pushing the boundaries" por @danielguillan
 
"One size fits none" por @martuishere
"One size fits none" por @martuishere"One size fits none" por @martuishere
"One size fits none" por @martuishere
 
"Designing digital products for kids" por @karinai
"Designing digital products for kids" por @karinai"Designing digital products for kids" por @karinai
"Designing digital products for kids" por @karinai
 
"How to write better User Stories" por @jrhuerta
"How to write better User Stories" por @jrhuerta"How to write better User Stories" por @jrhuerta
"How to write better User Stories" por @jrhuerta
 
"GTD & Pomodoro Technique" por @deambulando
"GTD & Pomodoro Technique" por @deambulando"GTD & Pomodoro Technique" por @deambulando
"GTD & Pomodoro Technique" por @deambulando
 
"Esqueuomorfismo: la ruptura de la metáfora" por @omixam
"Esqueuomorfismo: la ruptura de la metáfora" por @omixam"Esqueuomorfismo: la ruptura de la metáfora" por @omixam
"Esqueuomorfismo: la ruptura de la metáfora" por @omixam
 
"The work I love" por @karinai
"The work I love" por @karinai"The work I love" por @karinai
"The work I love" por @karinai
 
"APIS, como reutilizar contenidos en tu web" por @daniel_julia
"APIS, como reutilizar contenidos en tu web" por @daniel_julia"APIS, como reutilizar contenidos en tu web" por @daniel_julia
"APIS, como reutilizar contenidos en tu web" por @daniel_julia
 
"HTML & CSS apps & internet powered TV" por @JeronimJackson
"HTML & CSS apps & internet powered TV" por @JeronimJackson"HTML & CSS apps & internet powered TV" por @JeronimJackson
"HTML & CSS apps & internet powered TV" por @JeronimJackson
 
"Cuadro de mandos para UX. El método HEART" por @galu
"Cuadro de mandos para UX. El método HEART" por @galu"Cuadro de mandos para UX. El método HEART" por @galu
"Cuadro de mandos para UX. El método HEART" por @galu
 
"CSS Preprocessors Time!" por @nahuelsotelo
"CSS Preprocessors Time!" por @nahuelsotelo"CSS Preprocessors Time!" por @nahuelsotelo
"CSS Preprocessors Time!" por @nahuelsotelo
 
"Wordpress for web designers. What, when, how, where" por @nuriarai
"Wordpress for web designers. What, when, how, where" por @nuriarai"Wordpress for web designers. What, when, how, where" por @nuriarai
"Wordpress for web designers. What, when, how, where" por @nuriarai
 
"Humans.txt" por @JuanjoBernabeu y @lafabricaverde
"Humans.txt" por @JuanjoBernabeu y @lafabricaverde"Humans.txt" por @JuanjoBernabeu y @lafabricaverde
"Humans.txt" por @JuanjoBernabeu y @lafabricaverde
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

"Web performance optimization for everyone" por @abellonch