SlideShare una empresa de Scribd logo
1 de 61
To the Edge of Web
               Performance and
                    Beyond



Joshua Hull        @joshbuddy   http://github.com/joshbuddy
Preamble




Joshua Hull   @joshbuddy   http://github.com/joshbuddy
Preamble
                           Joshua Hull



                           @joshbuddy
                           http://github.com/joshbuddy
                           joshbuddy@gmail.com


                    (not switching to Python)

Joshua Hull   @joshbuddy                    http://github.com/joshbuddy
Preamble
                                                       m e !
                                     lo a d
                       o w n
                 D
     http://www.slideshare.net/joshbuddy/to-the-edge-of-web-performance-and-beyond




Joshua Hull                     @joshbuddy                     http://github.com/joshbuddy
To the Edge of Web
               Performance and
                    Beyond



Joshua Hull        @joshbuddy   http://github.com/joshbuddy
To the Edge of Web
               Performance and
                    Beyond



Joshua Hull        @joshbuddy   http://github.com/joshbuddy
To the Edge of Web
               Performance and
                    Beyond
                   (with solutions!)




Joshua Hull         @joshbuddy         http://github.com/joshbuddy
ESI




Joshua Hull   @joshbuddy   http://github.com/joshbuddy
ESI
              Edge     Side   Includes




Joshua Hull      @joshbuddy          http://github.com/joshbuddy
ESI
                  Edge           Side       Includes
              (not the origin)          (not only includes)




Joshua Hull            @joshbuddy                     http://github.com/joshbuddy
ESI
                           Edge
              http://www.w3.org/Icons/w3c_icon.svg
                                                           Side   Includes
                                                                        18/07/09 8:46 AM




Joshua Hull                                          @joshbuddy                http://github.com/joshbuddy
ESI
                     Edge       Side     Includes


      <esi:include src="http://www.example.com/new_user.html"/>




Joshua Hull               @joshbuddy              http://github.com/joshbuddy
ESI

                    Your caching is probably evil
              What does this ESI you speak of look like?
                     How can I actually use ESI?
                             Problems!




Joshua Hull               @joshbuddy          http://github.com/joshbuddy
Your caching is
               probably evil




Joshua Hull      @joshbuddy   http://github.com/joshbuddy
Your caching is
               probably evil


                       Fast




                       Fast
Joshua Hull      @joshbuddy   http://github.com/joshbuddy
Your caching is
                     probably evil



      (incorrect)


                           Correct
Joshua Hull            @joshbuddy    http://github.com/joshbuddy
Your caching is
               probably evil
 Caching is great                Caching really sucks




Joshua Hull         @joshbuddy        http://github.com/joshbuddy
Your caching is
               probably evil
 Caching is great




Joshua Hull         @joshbuddy   http://github.com/joshbuddy
Your caching is
                           probably evil
 Caching is great
         <html>
        <head>
        <title>
                My Page
       </head>          </title



                                           Cache
                                >
       <body>
         This pa
                 ge rock
      </body>            s.
      </html>


      Hard work



Joshua Hull                         @joshbuddy     http://github.com/joshbuddy
Your caching is
               probably evil
 Caching is great



Everything is peachy           Cache
                              Cache




Joshua Hull            @joshbuddy      http://github.com/joshbuddy
Your caching is
               probably evil




                   Victory?
Joshua Hull      @joshbuddy   http://github.com/joshbuddy
Your caching is
               probably evil
                              Caching really sucks




Joshua Hull      @joshbuddy        http://github.com/joshbuddy
Your caching is
               probably evil
                              Caching really sucks




Joshua Hull      @joshbuddy        http://github.com/joshbuddy
Your caching is
                       probably evil
                                      Caching really sucks
  Expensive DB call



Expensive filesystem
       magic




Joshua Hull              @joshbuddy        http://github.com/joshbuddy
Your caching is
                    probably evil
         User-specific
                                     Caching really sucks
        Result of web
           service
         DB intensive
         Other work

              ?

Joshua Hull             @joshbuddy        http://github.com/joshbuddy
Your caching is
               probably evil
                              Caching really sucks




Joshua Hull      @joshbuddy        http://github.com/joshbuddy
Your caching is
               probably evil
                                   Caching really sucks




                              1 4 0er   v ic es
                              webs


Joshua Hull      @joshbuddy                http://github.com/joshbuddy
Your caching is
               probably evil
                 Fragment caching




Joshua Hull       @joshbuddy        http://github.com/joshbuddy
Your caching is
               probably evil
                 Fragment caching
                <html>
                <head>
                <title>My Page</title>
                </head>
                <body>
                  <% cache do('my_fragment') %>
                    This fragment rocks.
                  <% end %>
                </body>
                </html>




Joshua Hull        @joshbuddy                     http://github.com/joshbuddy
Your caching is
                  probably evil
                      Fragment caching
                     <html>
                     <head>
                     <title>My Page</title>

          is this
                     </head>

    Who              <body>

           ents’
                       <% cache do('my_fragment') %>

    fragm
                         This fragment rocks.


             ller?
                       <% end %>

       ontro
                     </body>
     c               </html>




Joshua Hull             @joshbuddy                     http://github.com/joshbuddy
Your caching is
               probably evil
                  Fragment caching
              “Kitchen Sink” controllers
                    MainController
                 HomepageController
                NotAResourceController




Joshua Hull         @joshbuddy             http://github.com/joshbuddy
Your caching is
                probably evil
                     Fragment caching
                “Kitchen Sink” controllers
                       MainController
                    HomepageController
                   NotAResourceController
   Bake controller logic            Do a lot of extra logic
   into your fragments               in your controller


Joshua Hull            @joshbuddy            http://github.com/joshbuddy
Your caching is
                  probably evil
                        Fragment caching
                  “Kitchen Sink” controllers
                        MainController
                     HomepageController
                    NotAResourceController
   Bake controller logic              Do a lot of extra logic
   into your fragments                 in your controller
          Not correct                        Not fast
Joshua Hull              @joshbuddy            http://github.com/joshbuddy
Your caching is
               probably evil




Joshua Hull      @joshbuddy   http://github.com/joshbuddy
Your caching is
               probably evil
                http://upload.wikimedia.org/wikipedia/en/8/8b/Akamai_logo.svg             18/07/09 8:44 AM




Joshua Hull                     @joshbuddy                                      http://github.com/joshbuddy
Your caching is
                 probably evil
                    http://upload.wikimedia.org/wikipedia/en/8/8b/Akamai_logo.svg             18/07/09 8:44 AM




      A web page = A bunch of resources + a bit of logic




Joshua Hull                         @joshbuddy                                      http://github.com/joshbuddy
Your caching is
                 probably evil
                    http://upload.wikimedia.org/wikipedia/en/8/8b/Akamai_logo.svg             18/07/09 8:44 AM




      A web page = A bunch of resources + a bit of logic


                                                   E S I
                         http://www.w3.org/TR/esi-lang


Joshua Hull                         @joshbuddy                                      http://github.com/joshbuddy
What does this ESI you
          speak of look like?




Joshua Hull     @joshbuddy   http://github.com/joshbuddy
What does this ESI you
          speak of look like?

              include               try

               vars                choose


Joshua Hull           @joshbuddy          http://github.com/joshbuddy
What does this ESI you
          speak of look like?
        include                  <esi:include src="URI" alt="URI" onerror="continue" />




        Examples
        <esi:include src="/header" />
        <esi:include src="/header" alt="/alternate-header" />
        <esi:include src="/header" alt="/alternate-header" onerror="continue" />




Joshua Hull                         @joshbuddy                         http://github.com/joshbuddy
What does this ESI you
          speak of look like?
        try
                                 <esi:try>
                                   <esi:attempt> ... </esi:attempt>
                                   <esi:otherwise> ... </esi:otherwise>
                                 </esi:try>




         Example
         <esi:try>
           <esi:attempt>
             <esi:include src="/my-resource"/>
           </esi:attempt>
           <esi:except>This is bad</esi:except>
         </esi:try>




Joshua Hull                          @joshbuddy                           http://github.com/joshbuddy
What does this ESI you
          speak of look like?
        choose
                                 <esi:choose>
                                   <esi:when test=”...”> ... </esi:when>
                                   <esi:otherwise> ... </esi:otherwise>
                                 </esi:choose>




         Example
         <html><body>
           <esi:choose>
             <esi:when test="$(HTTP_ACCEPT_LANGUAGE{ja})">I speak Japanese</esi:when>
           </esi:choose>
           <esi:otherwise>
             I don't speak it, sorry bout that.
           </esi:otherwise>
         </body></html>




Joshua Hull                          @joshbuddy                        http://github.com/joshbuddy
What does this ESI you
          speak of look like?
        vars                     <esi:vars>...</esi:vars>




        Examples
        <esi:vars><img src="http://www.example.com/$(QUERY_STRING{greet})/hello.gif"/ ></esi:vars>
        <esi:vars>Your ID is $(HTTP_COOKIE{id})</esi:vars>




Joshua Hull                         @joshbuddy                         http://github.com/joshbuddy
What does this ESI you
          speak of look like?
        variable substitution

          HTTP_ACCEPT_LANGUAGE                Set (da, en-gb, en)
          HTTP_COOKIE                         Hash
          HTTP_HOST                           String
          HTTP_REFERER                        String
          HTTP_USER_AGENT                     Hash (os, version, browser)
          QUERY_STRING                        Hash



Joshua Hull                      @joshbuddy                         http://github.com/joshbuddy
What does this ESI you
          speak of look like?
        other bits

          ==, !=, <, >, <=, >=                Comparison
          !                                   Unary negation
          &                                   Logical and
          |                                   Logical or




Joshua Hull                      @joshbuddy                    http://github.com/joshbuddy
How can I actually use ESI?




Joshua Hull      @joshbuddy   http://github.com/joshbuddy
How can I actually use ESI?




                   Solutions!
Joshua Hull      @joshbuddy     http://github.com/joshbuddy
How can I actually use ESI?




              Actual working implementations
Joshua Hull           @joshbuddy         http://github.com/joshbuddy
How can I actually use ESI?
          Taf2 / nginx-esi
              http://github.com/taf2/nginx-esi
          Taf2 / mongrel-esi
              http://github.com/taf2/mongrel-esi
          Qerub / rack-esi
              http://github.com/Qerub/rack-esi
          Varnish
              http://varnish.projects.linpro.no/
          Joshbuddy / esi-for-rack
              http://varnish.projects.linpro.no/

Joshua Hull                       @joshbuddy       http://github.com/joshbuddy
How can I actually use ESI?
          Taf2 / nginx-esi
              http://github.com/taf2/nginx-esi
          Taf2 / mongrel-esi
                                                    A nd
              http://github.com/taf2/mongrel-esi
                                                       ba bly
          Qerub / rack-esi                         pro re!
              http://github.com/Qerub/rack-esi
                                                     mo
          Varnish
              http://varnish.projects.linpro.no/
          Joshbuddy / esi-for-rack
              http://varnish.projects.linpro.no/

Joshua Hull                       @joshbuddy       http://github.com/joshbuddy
How can I actually use ESI?




                Easy to work with
Joshua Hull      @joshbuddy         http://github.com/joshbuddy
How can I actually use ESI?
          Joshbuddy / spackle
              http://github.com/joshbuddy/spackle




Joshua Hull                     @joshbuddy          http://github.com/joshbuddy
How can I actually use ESI?
          Joshbuddy / spackle
               http://github.com/joshbuddy/spackle

          Controller
              esi(:user_bar, :path => ":variable/$(HTTP_COOKIE{esi-cookie})", :binds => [:cookie]) do |esi_params|
                render :text => "variable is #{params[:variable]}, cookie is #{params[:cookie]}"
              end




Joshua Hull                                  @joshbuddy                                http://github.com/joshbuddy
How can I actually use ESI?
          Joshbuddy / spackle
               http://github.com/joshbuddy/spackle

          Controller
              esi(:user_bar, :path => ":variable/$(HTTP_COOKIE{esi-cookie})", :binds => [:cookie]) do |esi_params|
                render :text => "variable is #{params[:variable]}, cookie is #{params[:cookie]}"
              end




                                                  def user_bar
                                                    # setup ...
                                                    user_bar_body
                                                  end

                                                  def user_bar_body
                                                    # your block
                                                  end




Joshua Hull                                  @joshbuddy                                http://github.com/joshbuddy
How can I actually use ESI?
          Joshbuddy / spackle
              http://github.com/joshbuddy/spackle

          View
              <%=esi_include(:user_bar, :test => "testing") %>



              <% esi_try do %>
                <% esi_attempt do %>
                  <%=esi_include(:user_bar, :test => "testing") %>
                <% end %>
              <% end %>



              <% esi_include do %>
                <%=esi_src(:user_bar, 'testing') %>
                <%=esi_alt("http://www.slashdot.org/") %>
              <% end %>



Joshua Hull                           @joshbuddy                     http://github.com/joshbuddy
How can I actually use ESI?




                     Security
Joshua Hull      @joshbuddy     http://github.com/joshbuddy
How can I actually use ESI?
          Joshbuddy / rack-tamperproof
              http://github.com/joshbuddy/rack-tamperproof




Joshua Hull                     @joshbuddy                   http://github.com/joshbuddy
How can I actually use ESI?
          Joshbuddy / rack-tamperproof
              http://github.com/joshbuddy/rack-tamperproof
                  use Rack::Tamperproof(:default_key => "123u9ew90uqn") do
                    delete_for :just_delete_this
                    exception_for :don_t_tamper
                  end

                  # delete_for cookies will delete if they are tampered
                  #   with and your request passes through normally
                  #
                  # exception_for produces an exception if the cookie
                  #   is tampered with




Joshua Hull                        @joshbuddy                         http://github.com/joshbuddy
Problems!




Joshua Hull   @joshbuddy   http://github.com/joshbuddy
Problems!
        Specification can be vague
        Implementations support different features
        Spackle doesn’t have tests




Joshua Hull             @joshbuddy          http://github.com/joshbuddy
Questions




Joshua Hull    @joshbuddy   http://github.com/joshbuddy

Más contenido relacionado

Último

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Último (20)

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

To the Edge of Web Performance and Beyond

  • 1. To the Edge of Web Performance and Beyond Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 2. Preamble Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 3. Preamble Joshua Hull @joshbuddy http://github.com/joshbuddy joshbuddy@gmail.com (not switching to Python) Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 4. Preamble m e ! lo a d o w n D http://www.slideshare.net/joshbuddy/to-the-edge-of-web-performance-and-beyond Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 5. To the Edge of Web Performance and Beyond Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 6. To the Edge of Web Performance and Beyond Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 7. To the Edge of Web Performance and Beyond (with solutions!) Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 8. ESI Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 9. ESI Edge Side Includes Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 10. ESI Edge Side Includes (not the origin) (not only includes) Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 11. ESI Edge http://www.w3.org/Icons/w3c_icon.svg Side Includes 18/07/09 8:46 AM Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 12. ESI Edge Side Includes <esi:include src="http://www.example.com/new_user.html"/> Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 13. ESI Your caching is probably evil What does this ESI you speak of look like? How can I actually use ESI? Problems! Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 14. Your caching is probably evil Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 15. Your caching is probably evil Fast Fast Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 16. Your caching is probably evil (incorrect) Correct Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 17. Your caching is probably evil Caching is great Caching really sucks Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 18. Your caching is probably evil Caching is great Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 19. Your caching is probably evil Caching is great <html> <head> <title> My Page </head> </title Cache > <body> This pa ge rock </body> s. </html> Hard work Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 20. Your caching is probably evil Caching is great Everything is peachy Cache Cache Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 21. Your caching is probably evil Victory? Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 22. Your caching is probably evil Caching really sucks Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 23. Your caching is probably evil Caching really sucks Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 24. Your caching is probably evil Caching really sucks Expensive DB call Expensive filesystem magic Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 25. Your caching is probably evil User-specific Caching really sucks Result of web service DB intensive Other work ? Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 26. Your caching is probably evil Caching really sucks Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 27. Your caching is probably evil Caching really sucks 1 4 0er v ic es webs Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 28. Your caching is probably evil Fragment caching Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 29. Your caching is probably evil Fragment caching <html> <head> <title>My Page</title> </head> <body> <% cache do('my_fragment') %> This fragment rocks. <% end %> </body> </html> Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 30. Your caching is probably evil Fragment caching <html> <head> <title>My Page</title> is this </head> Who <body> ents’ <% cache do('my_fragment') %> fragm This fragment rocks. ller? <% end %> ontro </body> c </html> Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 31. Your caching is probably evil Fragment caching “Kitchen Sink” controllers MainController HomepageController NotAResourceController Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 32. Your caching is probably evil Fragment caching “Kitchen Sink” controllers MainController HomepageController NotAResourceController Bake controller logic Do a lot of extra logic into your fragments in your controller Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 33. Your caching is probably evil Fragment caching “Kitchen Sink” controllers MainController HomepageController NotAResourceController Bake controller logic Do a lot of extra logic into your fragments in your controller Not correct Not fast Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 34. Your caching is probably evil Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 35. Your caching is probably evil http://upload.wikimedia.org/wikipedia/en/8/8b/Akamai_logo.svg 18/07/09 8:44 AM Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 36. Your caching is probably evil http://upload.wikimedia.org/wikipedia/en/8/8b/Akamai_logo.svg 18/07/09 8:44 AM A web page = A bunch of resources + a bit of logic Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 37. Your caching is probably evil http://upload.wikimedia.org/wikipedia/en/8/8b/Akamai_logo.svg 18/07/09 8:44 AM A web page = A bunch of resources + a bit of logic E S I http://www.w3.org/TR/esi-lang Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 38. What does this ESI you speak of look like? Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 39. What does this ESI you speak of look like? include try vars choose Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 40. What does this ESI you speak of look like? include <esi:include src="URI" alt="URI" onerror="continue" /> Examples <esi:include src="/header" /> <esi:include src="/header" alt="/alternate-header" /> <esi:include src="/header" alt="/alternate-header" onerror="continue" /> Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 41. What does this ESI you speak of look like? try <esi:try> <esi:attempt> ... </esi:attempt> <esi:otherwise> ... </esi:otherwise> </esi:try> Example <esi:try> <esi:attempt> <esi:include src="/my-resource"/> </esi:attempt> <esi:except>This is bad</esi:except> </esi:try> Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 42. What does this ESI you speak of look like? choose <esi:choose> <esi:when test=”...”> ... </esi:when> <esi:otherwise> ... </esi:otherwise> </esi:choose> Example <html><body> <esi:choose> <esi:when test="$(HTTP_ACCEPT_LANGUAGE{ja})">I speak Japanese</esi:when> </esi:choose> <esi:otherwise> I don't speak it, sorry bout that. </esi:otherwise> </body></html> Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 43. What does this ESI you speak of look like? vars <esi:vars>...</esi:vars> Examples <esi:vars><img src="http://www.example.com/$(QUERY_STRING{greet})/hello.gif"/ ></esi:vars> <esi:vars>Your ID is $(HTTP_COOKIE{id})</esi:vars> Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 44. What does this ESI you speak of look like? variable substitution HTTP_ACCEPT_LANGUAGE Set (da, en-gb, en) HTTP_COOKIE Hash HTTP_HOST String HTTP_REFERER String HTTP_USER_AGENT Hash (os, version, browser) QUERY_STRING Hash Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 45. What does this ESI you speak of look like? other bits ==, !=, <, >, <=, >= Comparison ! Unary negation & Logical and | Logical or Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 46. How can I actually use ESI? Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 47. How can I actually use ESI? Solutions! Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 48. How can I actually use ESI? Actual working implementations Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 49. How can I actually use ESI? Taf2 / nginx-esi http://github.com/taf2/nginx-esi Taf2 / mongrel-esi http://github.com/taf2/mongrel-esi Qerub / rack-esi http://github.com/Qerub/rack-esi Varnish http://varnish.projects.linpro.no/ Joshbuddy / esi-for-rack http://varnish.projects.linpro.no/ Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 50. How can I actually use ESI? Taf2 / nginx-esi http://github.com/taf2/nginx-esi Taf2 / mongrel-esi A nd http://github.com/taf2/mongrel-esi ba bly Qerub / rack-esi pro re! http://github.com/Qerub/rack-esi mo Varnish http://varnish.projects.linpro.no/ Joshbuddy / esi-for-rack http://varnish.projects.linpro.no/ Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 51. How can I actually use ESI? Easy to work with Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 52. How can I actually use ESI? Joshbuddy / spackle http://github.com/joshbuddy/spackle Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 53. How can I actually use ESI? Joshbuddy / spackle http://github.com/joshbuddy/spackle Controller esi(:user_bar, :path => ":variable/$(HTTP_COOKIE{esi-cookie})", :binds => [:cookie]) do |esi_params| render :text => "variable is #{params[:variable]}, cookie is #{params[:cookie]}" end Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 54. How can I actually use ESI? Joshbuddy / spackle http://github.com/joshbuddy/spackle Controller esi(:user_bar, :path => ":variable/$(HTTP_COOKIE{esi-cookie})", :binds => [:cookie]) do |esi_params| render :text => "variable is #{params[:variable]}, cookie is #{params[:cookie]}" end def user_bar # setup ... user_bar_body end def user_bar_body # your block end Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 55. How can I actually use ESI? Joshbuddy / spackle http://github.com/joshbuddy/spackle View <%=esi_include(:user_bar, :test => "testing") %> <% esi_try do %> <% esi_attempt do %> <%=esi_include(:user_bar, :test => "testing") %> <% end %> <% end %> <% esi_include do %> <%=esi_src(:user_bar, 'testing') %> <%=esi_alt("http://www.slashdot.org/") %> <% end %> Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 56. How can I actually use ESI? Security Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 57. How can I actually use ESI? Joshbuddy / rack-tamperproof http://github.com/joshbuddy/rack-tamperproof Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 58. How can I actually use ESI? Joshbuddy / rack-tamperproof http://github.com/joshbuddy/rack-tamperproof use Rack::Tamperproof(:default_key => "123u9ew90uqn") do delete_for :just_delete_this exception_for :don_t_tamper end # delete_for cookies will delete if they are tampered # with and your request passes through normally # # exception_for produces an exception if the cookie # is tampered with Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 59. Problems! Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 60. Problems! Specification can be vague Implementations support different features Spackle doesn’t have tests Joshua Hull @joshbuddy http://github.com/joshbuddy
  • 61. Questions Joshua Hull @joshbuddy http://github.com/joshbuddy