SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
The Fast, The Slow and
                             the Lazy
                                     Maurício Linhares - @mauriciojr
                                           http://techbot.me/




segunda-feira, 11 de abril de 2011
Who?

                              Java, Ruby, Objective-C, whatever

                              Developer at OfficeDrop.com

                              Agile Coach that hates scrum and loves
                              coding

                              Used to sing in a Heavy Metal band



segunda-feira, 11 de abril de 2011
Where?




segunda-feira, 11 de abril de 2011
Learn to respect the
                                HTTP protocol
                                     What about reading the RFC?




segunda-feira, 11 de abril de 2011
A GET is, in fact, “GET a
                             COPY”
                      And copying should not change your database,
                                         right?




segunda-feira, 11 de abril de 2011
When should we GET?

                              View information (images, movies, HTML
                              documents)

                              Searching (people should be able to
                              bookmark search results)

                              Web analytics (beacons and all that stuff)




segunda-feira, 11 de abril de 2011
POST is SENDING stuff
                          to the server
                                 And this would change your DATABASE




segunda-feira, 11 de abril de 2011
Idempotency principle
                            Many GETs == same result
                    Many POSTs == not necessarily the same result




segunda-feira, 11 de abril de 2011
Google Web Accelerator
                    An epic and dramatic story about how an #epic
                             #win becomes an #epic #fail




segunda-feira, 11 de abril de 2011
Front End Optimization
                       Easier than getting the Celtics to win an NBA
                                       championship




segunda-feira, 11 de abril de 2011
Use a proxy server to
                           deliver your content
                                               Nginx, please


                                     !"#$%&'       !"#$%&''    !"#$%&''
                                       ('            )'          *'




                                                   !"#$%&




segunda-feira, 11 de abril de 2011
Define a far future
                  expires header for all of
                     your static assets



segunda-feira, 11 de abril de 2011
Issues?

                              If you update the file, the browser will not
                              notice;

                              You’ll have to rename the file or add a
                              timestamp to tell the browser it has
                              changed (Rails does it for you!)

                                     /javascripts/jquery.js?12398766



segunda-feira, 11 de abril de 2011
Nginx config


      location ~ ^/(images|javascripts|stylesheets)/   {
        root /home/deployer/shop/current/public;
        expires max;
        break;
      }




segunda-feira, 11 de abril de 2011
Turn on GZIP
                                 compression in your
                                        proxy



segunda-feira, 11 de abril de 2011
Nginx config

      gzip on;
      gzip_http_version 1.0;
      gzip_proxied any;
      gzip_min_length 500;
      gzip_disable "MSIE [1-6].";
      gzip_types text/html text/xml text/
      javascript;




segunda-feira, 11 de abril de 2011
CSS files should be at
                          the beginning of your
                                  page


segunda-feira, 11 de abril de 2011
Use CSS sprites




segunda-feira, 11 de abril de 2011
At the CSS CSS

     <div	
  style="background-­‐image:	
  url
     ('a_lot_of_sprites.gif');
     	
  	
  	
  	
  background-­‐position:	
  -­‐260px	
  -­‐90px;
     	
  	
  	
  	
  width:	
  26px;	
  height:	
  24px;">
     </div>


segunda-feira, 11 de abril de 2011
Get a CDN to serve
                       your static assets and
                      user generated content
                                     CDN == Content Delivery Network
                                     S3, CloudFiles, Akamai, whatever...




segunda-feira, 11 de abril de 2011
Using Paperclip?
         has_attached_file :uploaded_data, :storage => :s3,
           :s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
           :s3_headers => { "Expires" => "Thu, 31 Dec 2037 23:55:55
     GMT", "Cache-Control" => "max-age=315360000" },
           :path => "/:class/:attachment/:id/:style_:filename",
            :styles => { :thumb => '173x84#' },
           :convert_options => { :all => '-strip' }




segunda-feira, 11 de abril de 2011
Merge all your CSS and
                     JavaScript files in a
                      single file for each
                                     :cache => “all_styles”
                                      If you’re using Rails




segunda-feira, 11 de abril de 2011
Crush all your PNG files
                                     pngcrush for the win




segunda-feira, 11 de abril de 2011
Serve static assets from
                     many different hosts
                                     assets1.myblog.com.br
                                     assets2.myblog.com.br
                                     assets3.myblog.com.br
                                     assets4.myblog.com.br




segunda-feira, 11 de abril de 2011
Remove all metadata
                               from your JPEGs
                            convert -strip source.jpeg destination.jpeg
                                           ImageMagick




segunda-feira, 11 de abril de 2011
JavaScript optimizations




segunda-feira, 11 de abril de 2011
Place scripts at the END
                         of your page



segunda-feira, 11 de abril de 2011
Download script files
                                asynchronously

                              document.write(“<script src=‘something.js’>”)

                              AJAX call then eval the body (RJS?
                              Remember?)

                              dom.createElement( “script” )



segunda-feira, 11 de abril de 2011
Minify your Scripts


                              YUI Compressor

                              JSMIN

                              JS Minifier




segunda-feira, 11 de abril de 2011
Separate your scripts in
                     MUST HAVE and CAN
                            WAIT
                                     beforeOnload.js
                                     afterOnload.js




segunda-feira, 11 de abril de 2011
Use AJAX requests to
                  navigate on your website
                                     Twitter.com? That’s it!




segunda-feira, 11 de abril de 2011
Questions?
                  Curses, compliments and money, now accepting all
                                    credit cards




segunda-feira, 11 de abril de 2011

Mais conteúdo relacionado

Mais procurados

Apache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEEApache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEE
Jacek Laskowski
 
UCLUG TorqueBox - 03/08/2011
UCLUG TorqueBox - 03/08/2011UCLUG TorqueBox - 03/08/2011
UCLUG TorqueBox - 03/08/2011
tobiascrawley
 
Create a Professional Blog with WordPress: Chapter 2 Installing Wordpress
Create a Professional Blog with WordPress: Chapter 2 Installing WordpressCreate a Professional Blog with WordPress: Chapter 2 Installing Wordpress
Create a Professional Blog with WordPress: Chapter 2 Installing Wordpress
Atit Patumvan
 
HootSuite Dev 2
HootSuite Dev 2HootSuite Dev 2
HootSuite Dev 2
ujihisa
 

Mais procurados (9)

Acceptance & Integration Testing With Behat (PBC11)
Acceptance & Integration Testing With Behat (PBC11)Acceptance & Integration Testing With Behat (PBC11)
Acceptance & Integration Testing With Behat (PBC11)
 
Apache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEEApache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEE
 
UCLUG TorqueBox - 03/08/2011
UCLUG TorqueBox - 03/08/2011UCLUG TorqueBox - 03/08/2011
UCLUG TorqueBox - 03/08/2011
 
A Look at the Future of HTML5
A Look at the Future of HTML5A Look at the Future of HTML5
A Look at the Future of HTML5
 
Apache TomEE, Java EE 6 Web Profile on Tomcat - David Blevins
Apache TomEE, Java EE 6 Web Profile on Tomcat - David BlevinsApache TomEE, Java EE 6 Web Profile on Tomcat - David Blevins
Apache TomEE, Java EE 6 Web Profile on Tomcat - David Blevins
 
Plone in the Cloud - an on-demand CMS hosted on Amazon EC2
Plone in the Cloud - an on-demand CMS hosted on Amazon EC2Plone in the Cloud - an on-demand CMS hosted on Amazon EC2
Plone in the Cloud - an on-demand CMS hosted on Amazon EC2
 
Create a Professional Blog with WordPress: Chapter 2 Installing Wordpress
Create a Professional Blog with WordPress: Chapter 2 Installing WordpressCreate a Professional Blog with WordPress: Chapter 2 Installing Wordpress
Create a Professional Blog with WordPress: Chapter 2 Installing Wordpress
 
Lucene, Solr and java 9 - opportunities and challenges
Lucene, Solr and java 9 - opportunities and challengesLucene, Solr and java 9 - opportunities and challenges
Lucene, Solr and java 9 - opportunities and challenges
 
HootSuite Dev 2
HootSuite Dev 2HootSuite Dev 2
HootSuite Dev 2
 

Destaque (9)

Extreme programming
Extreme programmingExtreme programming
Extreme programming
 
Análise de sistemas oo 1
Análise de sistemas oo   1Análise de sistemas oo   1
Análise de sistemas oo 1
 
Conhecendo o Decorator
Conhecendo o DecoratorConhecendo o Decorator
Conhecendo o Decorator
 
Introdução ao desenvolvimento web - 2 - iDez 2010
Introdução ao desenvolvimento web - 2 - iDez 2010Introdução ao desenvolvimento web - 2 - iDez 2010
Introdução ao desenvolvimento web - 2 - iDez 2010
 
Banco de dados dbo4
Banco de dados dbo4Banco de dados dbo4
Banco de dados dbo4
 
Curso java 01 - molhando os pés com java
Curso java   01 - molhando os pés com javaCurso java   01 - molhando os pés com java
Curso java 01 - molhando os pés com java
 
Apresentação sobre DB4O
Apresentação sobre DB4OApresentação sobre DB4O
Apresentação sobre DB4O
 
Migrando pra Scala
Migrando pra ScalaMigrando pra Scala
Migrando pra Scala
 
Além do java
Além do javaAlém do java
Além do java
 

Semelhante a The Fast, The Slow and the Lazy

international PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHPinternational PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHP
smueller_sandsmedia
 
Practical Cloud Security
Practical Cloud SecurityPractical Cloud Security
Practical Cloud Security
Jason Chan
 
Ruby hollywood
Ruby hollywoodRuby hollywood
Ruby hollywood
ehuard
 

Semelhante a The Fast, The Slow and the Lazy (20)

Groke
GrokeGroke
Groke
 
Caridy patino - node-js
Caridy patino - node-jsCaridy patino - node-js
Caridy patino - node-js
 
CommonJS Frameworks
CommonJS FrameworksCommonJS Frameworks
CommonJS Frameworks
 
international PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHPinternational PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHP
 
잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기
 
JavaScript Landscape
JavaScript LandscapeJavaScript Landscape
JavaScript Landscape
 
node.js for front-end developers
node.js for front-end developersnode.js for front-end developers
node.js for front-end developers
 
3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time 3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time
 
Practical Cloud Security
Practical Cloud SecurityPractical Cloud Security
Practical Cloud Security
 
AppScale Talk at SBonRails
AppScale Talk at SBonRailsAppScale Talk at SBonRails
AppScale Talk at SBonRails
 
CSS Power Tools
CSS Power ToolsCSS Power Tools
CSS Power Tools
 
Namesmatter
NamesmatterNamesmatter
Namesmatter
 
Ruby hollywood
Ruby hollywoodRuby hollywood
Ruby hollywood
 
HTML5 and jQuery for Flex Developers
HTML5 and jQuery for Flex DevelopersHTML5 and jQuery for Flex Developers
HTML5 and jQuery for Flex Developers
 
OSDC 2011 | Systemautomatisierung mit Chef by Jochen Lillich
OSDC 2011 | Systemautomatisierung mit Chef by Jochen LillichOSDC 2011 | Systemautomatisierung mit Chef by Jochen Lillich
OSDC 2011 | Systemautomatisierung mit Chef by Jochen Lillich
 
MongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema DesignMongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema Design
 
Node js techtalksto
Node js techtalkstoNode js techtalksto
Node js techtalksto
 
Advanced mysql replication techniques
Advanced mysql replication techniquesAdvanced mysql replication techniques
Advanced mysql replication techniques
 
RunDeck
RunDeckRunDeck
RunDeck
 
HTML XHTML HTML5
HTML XHTML HTML5HTML XHTML HTML5
HTML XHTML HTML5
 

Mais de Maurício Linhares

Curso java 08 - mais sobre coleções
Curso java   08 - mais sobre coleçõesCurso java   08 - mais sobre coleções
Curso java 08 - mais sobre coleções
Maurício Linhares
 
Curso java 06 - mais construtores, interfaces e polimorfismo
Curso java   06 - mais construtores, interfaces e polimorfismoCurso java   06 - mais construtores, interfaces e polimorfismo
Curso java 06 - mais construtores, interfaces e polimorfismo
Maurício Linhares
 
Curso java 05 - herança, classes e métodos abstratos
Curso java   05 - herança, classes e métodos abstratosCurso java   05 - herança, classes e métodos abstratos
Curso java 05 - herança, classes e métodos abstratos
Maurício Linhares
 
Curso java 04 - ap is e bibliotecas
Curso java   04 - ap is e bibliotecasCurso java   04 - ap is e bibliotecas
Curso java 04 - ap is e bibliotecas
Maurício Linhares
 
Curso java 03 - métodos e parâmetros
Curso java   03 - métodos e parâmetrosCurso java   03 - métodos e parâmetros
Curso java 03 - métodos e parâmetros
Maurício Linhares
 
Aulas de Java Avançado 2- Faculdade iDez 2010
Aulas de Java Avançado 2- Faculdade iDez 2010Aulas de Java Avançado 2- Faculdade iDez 2010
Aulas de Java Avançado 2- Faculdade iDez 2010
Maurício Linhares
 
Aulas de Java Avançado 1 - Faculdade iDez 2010
Aulas de Java Avançado 1 - Faculdade iDez 2010Aulas de Java Avançado 1 - Faculdade iDez 2010
Aulas de Java Avançado 1 - Faculdade iDez 2010
Maurício Linhares
 
Projeto e desenvolvimento de sistemas de informação 4 - computação em rede
Projeto e desenvolvimento de sistemas de informação   4 - computação em redeProjeto e desenvolvimento de sistemas de informação   4 - computação em rede
Projeto e desenvolvimento de sistemas de informação 4 - computação em rede
Maurício Linhares
 

Mais de Maurício Linhares (20)

Mercado de TI
Mercado de TIMercado de TI
Mercado de TI
 
Unindo Ruby e Java através de uma arquitetura orientada a serviços na OfficeDrop
Unindo Ruby e Java através de uma arquitetura orientada a serviços na OfficeDropUnindo Ruby e Java através de uma arquitetura orientada a serviços na OfficeDrop
Unindo Ruby e Java através de uma arquitetura orientada a serviços na OfficeDrop
 
Mixing Ruby and Java in a Service Oriented Architecture at OfficeDrop
Mixing Ruby and Java in a Service Oriented Architecture at OfficeDropMixing Ruby and Java in a Service Oriented Architecture at OfficeDrop
Mixing Ruby and Java in a Service Oriented Architecture at OfficeDrop
 
Aprendendo ruby
Aprendendo rubyAprendendo ruby
Aprendendo ruby
 
Curso java 07 - exceções
Curso java   07 - exceçõesCurso java   07 - exceções
Curso java 07 - exceções
 
Curso java 08 - mais sobre coleções
Curso java   08 - mais sobre coleçõesCurso java   08 - mais sobre coleções
Curso java 08 - mais sobre coleções
 
Curso java 06 - mais construtores, interfaces e polimorfismo
Curso java   06 - mais construtores, interfaces e polimorfismoCurso java   06 - mais construtores, interfaces e polimorfismo
Curso java 06 - mais construtores, interfaces e polimorfismo
 
Curso java 05 - herança, classes e métodos abstratos
Curso java   05 - herança, classes e métodos abstratosCurso java   05 - herança, classes e métodos abstratos
Curso java 05 - herança, classes e métodos abstratos
 
Curso java 04 - ap is e bibliotecas
Curso java   04 - ap is e bibliotecasCurso java   04 - ap is e bibliotecas
Curso java 04 - ap is e bibliotecas
 
Curso java 02 - variáveis
Curso java   02 - variáveisCurso java   02 - variáveis
Curso java 02 - variáveis
 
Curso java 03 - métodos e parâmetros
Curso java   03 - métodos e parâmetrosCurso java   03 - métodos e parâmetros
Curso java 03 - métodos e parâmetros
 
Feature Driven Development
Feature Driven DevelopmentFeature Driven Development
Feature Driven Development
 
Outsourcing e trabalho remoto para a nuvem
Outsourcing e trabalho remoto para a nuvemOutsourcing e trabalho remoto para a nuvem
Outsourcing e trabalho remoto para a nuvem
 
Mercado hoje
Mercado hojeMercado hoje
Mercado hoje
 
Revisão html e java script
Revisão html e java scriptRevisão html e java script
Revisão html e java script
 
Aulas de Java Avançado 2- Faculdade iDez 2010
Aulas de Java Avançado 2- Faculdade iDez 2010Aulas de Java Avançado 2- Faculdade iDez 2010
Aulas de Java Avançado 2- Faculdade iDez 2010
 
Aulas de Java Avançado 1 - Faculdade iDez 2010
Aulas de Java Avançado 1 - Faculdade iDez 2010Aulas de Java Avançado 1 - Faculdade iDez 2010
Aulas de Java Avançado 1 - Faculdade iDez 2010
 
Projeto e desenvolvimento de sistemas de informação 4 - computação em rede
Projeto e desenvolvimento de sistemas de informação   4 - computação em redeProjeto e desenvolvimento de sistemas de informação   4 - computação em rede
Projeto e desenvolvimento de sistemas de informação 4 - computação em rede
 
Extreme programming explicada
Extreme programming explicadaExtreme programming explicada
Extreme programming explicada
 
Jdbc e hibernate
Jdbc e hibernateJdbc e hibernate
Jdbc e hibernate
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

The Fast, The Slow and the Lazy

  • 1. The Fast, The Slow and the Lazy Maurício Linhares - @mauriciojr http://techbot.me/ segunda-feira, 11 de abril de 2011
  • 2. Who? Java, Ruby, Objective-C, whatever Developer at OfficeDrop.com Agile Coach that hates scrum and loves coding Used to sing in a Heavy Metal band segunda-feira, 11 de abril de 2011
  • 4. Learn to respect the HTTP protocol What about reading the RFC? segunda-feira, 11 de abril de 2011
  • 5. A GET is, in fact, “GET a COPY” And copying should not change your database, right? segunda-feira, 11 de abril de 2011
  • 6. When should we GET? View information (images, movies, HTML documents) Searching (people should be able to bookmark search results) Web analytics (beacons and all that stuff) segunda-feira, 11 de abril de 2011
  • 7. POST is SENDING stuff to the server And this would change your DATABASE segunda-feira, 11 de abril de 2011
  • 8. Idempotency principle Many GETs == same result Many POSTs == not necessarily the same result segunda-feira, 11 de abril de 2011
  • 9. Google Web Accelerator An epic and dramatic story about how an #epic #win becomes an #epic #fail segunda-feira, 11 de abril de 2011
  • 10. Front End Optimization Easier than getting the Celtics to win an NBA championship segunda-feira, 11 de abril de 2011
  • 11. Use a proxy server to deliver your content Nginx, please !"#$%&' !"#$%&'' !"#$%&'' (' )' *' !"#$%& segunda-feira, 11 de abril de 2011
  • 12. Define a far future expires header for all of your static assets segunda-feira, 11 de abril de 2011
  • 13. Issues? If you update the file, the browser will not notice; You’ll have to rename the file or add a timestamp to tell the browser it has changed (Rails does it for you!) /javascripts/jquery.js?12398766 segunda-feira, 11 de abril de 2011
  • 14. Nginx config location ~ ^/(images|javascripts|stylesheets)/ { root /home/deployer/shop/current/public;   expires max;   break; } segunda-feira, 11 de abril de 2011
  • 15. Turn on GZIP compression in your proxy segunda-feira, 11 de abril de 2011
  • 16. Nginx config gzip on; gzip_http_version 1.0; gzip_proxied any; gzip_min_length 500; gzip_disable "MSIE [1-6]."; gzip_types text/html text/xml text/ javascript; segunda-feira, 11 de abril de 2011
  • 17. CSS files should be at the beginning of your page segunda-feira, 11 de abril de 2011
  • 18. Use CSS sprites segunda-feira, 11 de abril de 2011
  • 19. At the CSS CSS <div  style="background-­‐image:  url ('a_lot_of_sprites.gif');        background-­‐position:  -­‐260px  -­‐90px;        width:  26px;  height:  24px;"> </div> segunda-feira, 11 de abril de 2011
  • 20. Get a CDN to serve your static assets and user generated content CDN == Content Delivery Network S3, CloudFiles, Akamai, whatever... segunda-feira, 11 de abril de 2011
  • 21. Using Paperclip? has_attached_file :uploaded_data, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", :s3_headers => { "Expires" => "Thu, 31 Dec 2037 23:55:55 GMT", "Cache-Control" => "max-age=315360000" }, :path => "/:class/:attachment/:id/:style_:filename", :styles => { :thumb => '173x84#' }, :convert_options => { :all => '-strip' } segunda-feira, 11 de abril de 2011
  • 22. Merge all your CSS and JavaScript files in a single file for each :cache => “all_styles” If you’re using Rails segunda-feira, 11 de abril de 2011
  • 23. Crush all your PNG files pngcrush for the win segunda-feira, 11 de abril de 2011
  • 24. Serve static assets from many different hosts assets1.myblog.com.br assets2.myblog.com.br assets3.myblog.com.br assets4.myblog.com.br segunda-feira, 11 de abril de 2011
  • 25. Remove all metadata from your JPEGs convert -strip source.jpeg destination.jpeg ImageMagick segunda-feira, 11 de abril de 2011
  • 27. Place scripts at the END of your page segunda-feira, 11 de abril de 2011
  • 28. Download script files asynchronously document.write(“<script src=‘something.js’>”) AJAX call then eval the body (RJS? Remember?) dom.createElement( “script” ) segunda-feira, 11 de abril de 2011
  • 29. Minify your Scripts YUI Compressor JSMIN JS Minifier segunda-feira, 11 de abril de 2011
  • 30. Separate your scripts in MUST HAVE and CAN WAIT beforeOnload.js afterOnload.js segunda-feira, 11 de abril de 2011
  • 31. Use AJAX requests to navigate on your website Twitter.com? That’s it! segunda-feira, 11 de abril de 2011
  • 32. Questions? Curses, compliments and money, now accepting all credit cards segunda-feira, 11 de abril de 2011