SlideShare uma empresa Scribd logo
1 de 52
HTTP Caching und Varnish

             Cologne Web Performance
                Optimization Group



SensioLabs                             Créateur du framework Symfony
Dennis Benkert
   •   @denderello
   •   Sensio Labs Deutschland
   •   Software Developer
   •   symfony 1.x & Symfony2
   •   Cloud Architekturen




SensioLabs                2      Créateur du framework Symfony
3
http://www.flickr.com/photos/68751915@N05/6869768383/
HTTP Caching

                                                 4
    http://www.flickr.com/photos/michelkuik/161160973/
SensioLabs   5   Créateur du framework Symfony
~500 ms        ~100 ms




SensioLabs             6   Créateur du framework Symfony
~200 ms   ~100 ms




SensioLabs               7   Créateur du framework Symfony
Doppelte Generierung vermeiden


                                                            8
          http://www.flickr.com/photos/donaldmacleod/3439612846/
Reverse
                  Proxy




SensioLabs   9             Créateur du framework Symfony
HTTP Headers FTW!

                                                        10
           http://www.flickr.com/photos/trentstrohm/205858578/
GET / HTTP/1.1
          Host: http://example.com



     GET/HTTP/1.1Host:http.trainings.sensiolabs.com




SensioLabs                             11             Créateur du framework Symfony
HTTP/1.1 200 OK
          Date: Wed, 15 Oct 2005 07:07:07 GMT
          Server: Apache
          Content-Length: 14
          Content-Type: text/html
     GET/HTTP/1.1Host:http.trainings.sensiolabs.com

          HelloWorld!




SensioLabs                             12             Créateur du framework Symfony
HTTP Expiration




SensioLabs         13          Créateur du framework Symfony
HTTP/1.1 200 OK
          …
          Cache--Control: s-­­maxage=10

          HelloWorld!
     GET/HTTP/1.1Host:http.trainings.sensiolabs.com




SensioLabs                             14             Créateur du framework Symfony
HTTP/1.1   Reverse
             Client                         App
                       200 OK     Proxy




SensioLabs                       15        Créateur du framework Symfony
HTTP/1.1   Reverse
             Client                         App
                       200 OK     Proxy




SensioLabs                       16        Créateur du framework Symfony
HTTP Validation




SensioLabs        17           Créateur du framework Symfony
HTTP/1.1 200 OK
          …
          Last-Modified: Thu 15 Oct 2005 07:00 …

          HelloWorld!
     GET/HTTP/1.1Host:http.trainings.sensiolabs.com




SensioLabs                             18             Créateur du framework Symfony
HTTP/1.1   Reverse
             Client                                     App
                       200 OK     Proxy




                                         HTTP/1.1
                                       Last-Modified




SensioLabs                       19                    Créateur du framework Symfony
HTTP/1.1        Reverse
             Client                                               App
                      304 Not Modified    Proxy




                                                 HTTP/1.1
                                              304 Not Modified




SensioLabs                               20                      Créateur du framework Symfony
REVERSE PROXY CACHE

              SURROGATE CACHE

               GATEWAY CACHE

              HTTP ACCELERATOR


SensioLabs           21        Créateur du framework Symfony
Varnish Cache

                22
Varnish
   •   HTTP accelerator (Webbeschleuniger)
   •   Programmiert in C
   •   Stark Thread-basiert
   •   Gutes Speichermanagement
   •   Eigene Konfigurationssprache
   •   ESI Support




SensioLabs                23                 Créateur du framework Symfony
Varnish Configuration Language
                    VCL



SensioLabs         24          Créateur du framework Symfony
backend default {
            .host = "192.168.0.10";
            .port = "8080";
          }
     GET/HTTP/1.1Host:http.trainings.sensiolabs.com




SensioLabs                             25             Créateur du framework Symfony
Backend?




SensioLabs     26       Créateur du framework Symfony
Backend        Varnish




SensioLabs             27             Créateur du framework Symfony
Varnish
             Backend




SensioLabs      28               Créateur du framework Symfony
backend default {
            .host = "192.168.0.1";
            .port = "8080";
          }
     GET/HTTP/1.1Host:http.trainings.sensiolabs.com
          backend images {
            .host = "192.168.0.2";
            .port = "8080";
          }




SensioLabs                             29             Créateur du framework Symfony
sub vcl_recv {
             setreq.backend = app;
             if(req.url ~ ".(gif|jpg)$") {
                 setreq.backend = images;
             }
     GET/HTTP/1.1Host:http.trainings.sensiolabs.com
         }




SensioLabs                 30                   Créateur du framework Symfony
sub?!




SensioLabs   31      Créateur du framework Symfony
vcl_recv?!!111




SensioLabs        32          Créateur du framework Symfony
Varnish Subroutines




SensioLabs          33             Créateur du framework Symfony
Miss




SensioLabs   34     Créateur du framework Symfony
Request    vcl_recv          vcl_hash




                                                 Cached?




                                                vcl_miss




   Response   vcl_deliver           vcl_fetch



SensioLabs                  35                  Créateur du framework Symfony
Hit




SensioLabs   36    Créateur du framework Symfony
Request    vcl_recv          vcl_hash




                                             Cached?




                vcl_hit




   Response   vcl_deliver



SensioLabs                  37              Créateur du framework Symfony
Pipe




SensioLabs   38     Créateur du framework Symfony
Request     vcl_recv




     vcl_pipe




    Response



SensioLabs                 39   Créateur du framework Symfony
Pass




SensioLabs   40     Créateur du framework Symfony
Request    vcl_recv          vcl_hash




                                                  Cached?
              vcl_pass




                                 vcl_hit         vcl_miss




   Response   vcl_deliver            vcl_fetch



SensioLabs                  41                   Créateur du framework Symfony
Header Manipulation




SensioLabs           42            Créateur du framework Symfony
sub vcl_deliver {
            setresp.http.X-Cache-Hits =
              obj.hits;
          }
     GET/HTTP/1.1Host:http.trainings.sensiolabs.com




SensioLabs                             43             Créateur du framework Symfony
HTTP/1.1 200 OK
          …
          X-Cache-Hits: 5
          …
     GET/HTTP/1.1Host:http.trainings.sensiolabs.com




SensioLabs                             44             Créateur du framework Symfony
Edge Side Includes
                     ESI



SensioLabs          45            Créateur du framework Symfony
SensioLabs   46   Créateur du framework Symfony
<html>
           <body>
             Some content
             <esi:include src="http://" />
             More content
     GET/HTTP/1.1Host:http.trainings.sensiolabs.com
           </body>
         </html>




SensioLabs                  47                   Créateur du framework Symfony
SensioLabs   48   Créateur du framework Symfony
Webseite




                      Kompletter   Reverse
             Client    Content                           App
                                    Proxy




                                             ESI




SensioLabs                         49                   Créateur du framework Symfony
SensioLabs   50   Créateur du framework Symfony
Webseite




                      Reverse
             Client                         App
                       Proxy




                                ESI




SensioLabs            51                   Créateur du framework Symfony
Und das war nur ein Ausblick…




SensioLabs       52         Créateur du framework Symfony

Mais conteúdo relacionado

Mais procurados

Symfony2: 30 astuces et bonnes pratiques
Symfony2: 30 astuces et bonnes pratiquesSymfony2: 30 astuces et bonnes pratiques
Symfony2: 30 astuces et bonnes pratiquesNoel GUILBERT
 
Symfony 2 : chapitre 1 - Présentation Générale
Symfony 2 : chapitre 1 - Présentation GénéraleSymfony 2 : chapitre 1 - Présentation Générale
Symfony 2 : chapitre 1 - Présentation GénéraleAbdelkader Rhouati
 
Exposer des services web SOAP et REST avec symfony 1.4 et Zend Framework
Exposer des services web SOAP et REST avec symfony 1.4 et Zend FrameworkExposer des services web SOAP et REST avec symfony 1.4 et Zend Framework
Exposer des services web SOAP et REST avec symfony 1.4 et Zend FrameworkHugo Hamon
 
Presentation Symfony
Presentation SymfonyPresentation Symfony
Presentation SymfonyJeremy Gachet
 
Orchestrez vos projets Symfony sans fausses notes
Orchestrez vos projets Symfony sans fausses notesOrchestrez vos projets Symfony sans fausses notes
Orchestrez vos projets Symfony sans fausses notesXavier Gorse
 
Présentation de PHP 5.4 [FR]
Présentation de PHP 5.4 [FR]Présentation de PHP 5.4 [FR]
Présentation de PHP 5.4 [FR]Wixiweb
 
Spring boot anane maryem ben aziza syrine
Spring boot anane maryem ben aziza syrineSpring boot anane maryem ben aziza syrine
Spring boot anane maryem ben aziza syrineSyrine Ben aziza
 

Mais procurados (7)

Symfony2: 30 astuces et bonnes pratiques
Symfony2: 30 astuces et bonnes pratiquesSymfony2: 30 astuces et bonnes pratiques
Symfony2: 30 astuces et bonnes pratiques
 
Symfony 2 : chapitre 1 - Présentation Générale
Symfony 2 : chapitre 1 - Présentation GénéraleSymfony 2 : chapitre 1 - Présentation Générale
Symfony 2 : chapitre 1 - Présentation Générale
 
Exposer des services web SOAP et REST avec symfony 1.4 et Zend Framework
Exposer des services web SOAP et REST avec symfony 1.4 et Zend FrameworkExposer des services web SOAP et REST avec symfony 1.4 et Zend Framework
Exposer des services web SOAP et REST avec symfony 1.4 et Zend Framework
 
Presentation Symfony
Presentation SymfonyPresentation Symfony
Presentation Symfony
 
Orchestrez vos projets Symfony sans fausses notes
Orchestrez vos projets Symfony sans fausses notesOrchestrez vos projets Symfony sans fausses notes
Orchestrez vos projets Symfony sans fausses notes
 
Présentation de PHP 5.4 [FR]
Présentation de PHP 5.4 [FR]Présentation de PHP 5.4 [FR]
Présentation de PHP 5.4 [FR]
 
Spring boot anane maryem ben aziza syrine
Spring boot anane maryem ben aziza syrineSpring boot anane maryem ben aziza syrine
Spring boot anane maryem ben aziza syrine
 

Destaque

Things Your Mother Didnt Tell You About Bundle Configurations - Symfony Live…
Things Your Mother Didnt Tell You About Bundle Configurations - Symfony Live…Things Your Mother Didnt Tell You About Bundle Configurations - Symfony Live…
Things Your Mother Didnt Tell You About Bundle Configurations - Symfony Live…D
 
symfony live 2010 - Using symfony events to create clean class interfaces
symfony live 2010 - Using symfony events to create clean class interfacessymfony live 2010 - Using symfony events to create clean class interfaces
symfony live 2010 - Using symfony events to create clean class interfacesD
 
Microservices Docker @Bonn Agile
Microservices Docker @Bonn AgileMicroservices Docker @Bonn Agile
Microservices Docker @Bonn AgileTimo Derstappen
 
Giant Swarm @Devhouse friday
Giant Swarm @Devhouse fridayGiant Swarm @Devhouse friday
Giant Swarm @Devhouse fridayTimo Derstappen
 
Container Orchestration @Docker Meetup Hamburg
Container Orchestration @Docker Meetup HamburgContainer Orchestration @Docker Meetup Hamburg
Container Orchestration @Docker Meetup HamburgTimo Derstappen
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneD
 
CoreOS @Codetalks Hamburg
CoreOS @Codetalks HamburgCoreOS @Codetalks Hamburg
CoreOS @Codetalks HamburgTimo Derstappen
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014D
 

Destaque (8)

Things Your Mother Didnt Tell You About Bundle Configurations - Symfony Live…
Things Your Mother Didnt Tell You About Bundle Configurations - Symfony Live…Things Your Mother Didnt Tell You About Bundle Configurations - Symfony Live…
Things Your Mother Didnt Tell You About Bundle Configurations - Symfony Live…
 
symfony live 2010 - Using symfony events to create clean class interfaces
symfony live 2010 - Using symfony events to create clean class interfacessymfony live 2010 - Using symfony events to create clean class interfaces
symfony live 2010 - Using symfony events to create clean class interfaces
 
Microservices Docker @Bonn Agile
Microservices Docker @Bonn AgileMicroservices Docker @Bonn Agile
Microservices Docker @Bonn Agile
 
Giant Swarm @Devhouse friday
Giant Swarm @Devhouse fridayGiant Swarm @Devhouse friday
Giant Swarm @Devhouse friday
 
Container Orchestration @Docker Meetup Hamburg
Container Orchestration @Docker Meetup HamburgContainer Orchestration @Docker Meetup Hamburg
Container Orchestration @Docker Meetup Hamburg
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
CoreOS @Codetalks Hamburg
CoreOS @Codetalks HamburgCoreOS @Codetalks Hamburg
CoreOS @Codetalks Hamburg
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 

Semelhante a Cologne Web Performance Optimization Group Web - Varnish

Performance au quotidien dans un environnement symfony
Performance au quotidien dans un environnement symfonyPerformance au quotidien dans un environnement symfony
Performance au quotidien dans un environnement symfonyXavier Leune
 
Symfony 4 2019
Symfony 4 2019Symfony 4 2019
Symfony 4 2019Eric Para
 
retour sur confoo2011 et Symfony2
retour sur confoo2011 et Symfony2retour sur confoo2011 et Symfony2
retour sur confoo2011 et Symfony2Saad Tazi
 
Atelier Symfony2- Introduction
Atelier Symfony2- IntroductionAtelier Symfony2- Introduction
Atelier Symfony2- IntroductionMarwa OUNALLI
 
Atelier symfony n 1
Atelier symfony n 1Atelier symfony n 1
Atelier symfony n 1Amir Souissi
 
Symphonie pour PHP industrialisé en agilité majeure
Symphonie pour PHP industrialisé en agilité majeureSymphonie pour PHP industrialisé en agilité majeure
Symphonie pour PHP industrialisé en agilité majeureJonathan Bonzy
 
Symphonie pour PHP industrialisé en agilité majeure
Symphonie pour PHP industrialisé en agilité majeureSymphonie pour PHP industrialisé en agilité majeure
Symphonie pour PHP industrialisé en agilité majeureMarc Nazarian
 
2013 01-08-php-maturite
2013 01-08-php-maturite2013 01-08-php-maturite
2013 01-08-php-maturiteRémi Alvado
 
Boostez vos-developpements-symfony-avec-phpedit
Boostez vos-developpements-symfony-avec-phpeditBoostez vos-developpements-symfony-avec-phpedit
Boostez vos-developpements-symfony-avec-phpeditauto entrepreneur
 
Atelier symfony n 2
Atelier symfony n 2Atelier symfony n 2
Atelier symfony n 2Amir Souissi
 
Princesse CI au pays des tests
Princesse CI au pays des testsPrincesse CI au pays des tests
Princesse CI au pays des testsHubert Lenoir
 
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8 Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8 Mickaël Rémond
 
Build automatique et distribution OTA avec Xcode 4.x et Jenkins
Build automatique et distribution OTA avec Xcode 4.x et JenkinsBuild automatique et distribution OTA avec Xcode 4.x et Jenkins
Build automatique et distribution OTA avec Xcode 4.x et JenkinsCocoaHeads France
 
Gestion des dépendances dans un projet PHP - Forum PHP 2012
Gestion des dépendances dans un projet PHP - Forum PHP 2012Gestion des dépendances dans un projet PHP - Forum PHP 2012
Gestion des dépendances dans un projet PHP - Forum PHP 2012Jean-Marc Fontaine
 
Gestion des dépendances dans un projet PHP - RMLL 2012
Gestion des dépendances dans un projet PHP - RMLL 2012Gestion des dépendances dans un projet PHP - RMLL 2012
Gestion des dépendances dans un projet PHP - RMLL 2012Jean-Marc Fontaine
 
Quid de vos applications symfony 1
Quid de vos applications symfony 1Quid de vos applications symfony 1
Quid de vos applications symfony 1marchugon
 
symfony: Simplifier vos développement Web professionnels avec PHP (Symfony P...
symfony: Simplifier vos développement Web professionnels avec PHP (Symfony P...symfony: Simplifier vos développement Web professionnels avec PHP (Symfony P...
symfony: Simplifier vos développement Web professionnels avec PHP (Symfony P...Fabien Potencier
 
20081008 - Tours Jug - Apache Maven
20081008  - Tours Jug - Apache Maven20081008  - Tours Jug - Apache Maven
20081008 - Tours Jug - Apache MavenArnaud Héritier
 
symfony : Simplifier le développement des interfaces bases de données (PHP ...
symfony : Simplifier le développement des interfaces bases de données (PHP ...symfony : Simplifier le développement des interfaces bases de données (PHP ...
symfony : Simplifier le développement des interfaces bases de données (PHP ...Fabien Potencier
 
Présentation de CakePHP, 22/04/2010
Présentation de CakePHP, 22/04/2010Présentation de CakePHP, 22/04/2010
Présentation de CakePHP, 22/04/2010Guillaume Sautereau
 

Semelhante a Cologne Web Performance Optimization Group Web - Varnish (20)

Performance au quotidien dans un environnement symfony
Performance au quotidien dans un environnement symfonyPerformance au quotidien dans un environnement symfony
Performance au quotidien dans un environnement symfony
 
Symfony 4 2019
Symfony 4 2019Symfony 4 2019
Symfony 4 2019
 
retour sur confoo2011 et Symfony2
retour sur confoo2011 et Symfony2retour sur confoo2011 et Symfony2
retour sur confoo2011 et Symfony2
 
Atelier Symfony2- Introduction
Atelier Symfony2- IntroductionAtelier Symfony2- Introduction
Atelier Symfony2- Introduction
 
Atelier symfony n 1
Atelier symfony n 1Atelier symfony n 1
Atelier symfony n 1
 
Symphonie pour PHP industrialisé en agilité majeure
Symphonie pour PHP industrialisé en agilité majeureSymphonie pour PHP industrialisé en agilité majeure
Symphonie pour PHP industrialisé en agilité majeure
 
Symphonie pour PHP industrialisé en agilité majeure
Symphonie pour PHP industrialisé en agilité majeureSymphonie pour PHP industrialisé en agilité majeure
Symphonie pour PHP industrialisé en agilité majeure
 
2013 01-08-php-maturite
2013 01-08-php-maturite2013 01-08-php-maturite
2013 01-08-php-maturite
 
Boostez vos-developpements-symfony-avec-phpedit
Boostez vos-developpements-symfony-avec-phpeditBoostez vos-developpements-symfony-avec-phpedit
Boostez vos-developpements-symfony-avec-phpedit
 
Atelier symfony n 2
Atelier symfony n 2Atelier symfony n 2
Atelier symfony n 2
 
Princesse CI au pays des tests
Princesse CI au pays des testsPrincesse CI au pays des tests
Princesse CI au pays des tests
 
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8 Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
 
Build automatique et distribution OTA avec Xcode 4.x et Jenkins
Build automatique et distribution OTA avec Xcode 4.x et JenkinsBuild automatique et distribution OTA avec Xcode 4.x et Jenkins
Build automatique et distribution OTA avec Xcode 4.x et Jenkins
 
Gestion des dépendances dans un projet PHP - Forum PHP 2012
Gestion des dépendances dans un projet PHP - Forum PHP 2012Gestion des dépendances dans un projet PHP - Forum PHP 2012
Gestion des dépendances dans un projet PHP - Forum PHP 2012
 
Gestion des dépendances dans un projet PHP - RMLL 2012
Gestion des dépendances dans un projet PHP - RMLL 2012Gestion des dépendances dans un projet PHP - RMLL 2012
Gestion des dépendances dans un projet PHP - RMLL 2012
 
Quid de vos applications symfony 1
Quid de vos applications symfony 1Quid de vos applications symfony 1
Quid de vos applications symfony 1
 
symfony: Simplifier vos développement Web professionnels avec PHP (Symfony P...
symfony: Simplifier vos développement Web professionnels avec PHP (Symfony P...symfony: Simplifier vos développement Web professionnels avec PHP (Symfony P...
symfony: Simplifier vos développement Web professionnels avec PHP (Symfony P...
 
20081008 - Tours Jug - Apache Maven
20081008  - Tours Jug - Apache Maven20081008  - Tours Jug - Apache Maven
20081008 - Tours Jug - Apache Maven
 
symfony : Simplifier le développement des interfaces bases de données (PHP ...
symfony : Simplifier le développement des interfaces bases de données (PHP ...symfony : Simplifier le développement des interfaces bases de données (PHP ...
symfony : Simplifier le développement des interfaces bases de données (PHP ...
 
Présentation de CakePHP, 22/04/2010
Présentation de CakePHP, 22/04/2010Présentation de CakePHP, 22/04/2010
Présentation de CakePHP, 22/04/2010
 

Mais de D

Monitoring und Metriken im Wunderland
Monitoring und Metriken im WunderlandMonitoring und Metriken im Wunderland
Monitoring und Metriken im WunderlandD
 
The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013D
 
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013D
 
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...D
 
Things Your Mother Didn't Tell You About Bundle Configurations - Symfony Live...
Things Your Mother Didn't Tell You About Bundle Configurations - Symfony Live...Things Your Mother Didn't Tell You About Bundle Configurations - Symfony Live...
Things Your Mother Didn't Tell You About Bundle Configurations - Symfony Live...D
 
What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012D
 
symfony Live 2010 - Using Doctrine Migrations
symfony Live 2010 -  Using Doctrine Migrationssymfony Live 2010 -  Using Doctrine Migrations
symfony Live 2010 - Using Doctrine MigrationsD
 
symfony and immobilienscout24.de - Dennis Benkert
symfony and immobilienscout24.de - Dennis Benkertsymfony and immobilienscout24.de - Dennis Benkert
symfony and immobilienscout24.de - Dennis BenkertD
 
symfony and immobilienscout24.de - Rob Bors
symfony and immobilienscout24.de - Rob Borssymfony and immobilienscout24.de - Rob Bors
symfony and immobilienscout24.de - Rob BorsD
 
Railslove Lightningtalk 20 02 09 - Web Debug Toolbars
Railslove Lightningtalk 20 02 09 - Web Debug ToolbarsRailslove Lightningtalk 20 02 09 - Web Debug Toolbars
Railslove Lightningtalk 20 02 09 - Web Debug ToolbarsD
 

Mais de D (10)

Monitoring und Metriken im Wunderland
Monitoring und Metriken im WunderlandMonitoring und Metriken im Wunderland
Monitoring und Metriken im Wunderland
 
The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013
 
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
 
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
 
Things Your Mother Didn't Tell You About Bundle Configurations - Symfony Live...
Things Your Mother Didn't Tell You About Bundle Configurations - Symfony Live...Things Your Mother Didn't Tell You About Bundle Configurations - Symfony Live...
Things Your Mother Didn't Tell You About Bundle Configurations - Symfony Live...
 
What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012
 
symfony Live 2010 - Using Doctrine Migrations
symfony Live 2010 -  Using Doctrine Migrationssymfony Live 2010 -  Using Doctrine Migrations
symfony Live 2010 - Using Doctrine Migrations
 
symfony and immobilienscout24.de - Dennis Benkert
symfony and immobilienscout24.de - Dennis Benkertsymfony and immobilienscout24.de - Dennis Benkert
symfony and immobilienscout24.de - Dennis Benkert
 
symfony and immobilienscout24.de - Rob Bors
symfony and immobilienscout24.de - Rob Borssymfony and immobilienscout24.de - Rob Bors
symfony and immobilienscout24.de - Rob Bors
 
Railslove Lightningtalk 20 02 09 - Web Debug Toolbars
Railslove Lightningtalk 20 02 09 - Web Debug ToolbarsRailslove Lightningtalk 20 02 09 - Web Debug Toolbars
Railslove Lightningtalk 20 02 09 - Web Debug Toolbars
 

Cologne Web Performance Optimization Group Web - Varnish

  • 1. HTTP Caching und Varnish Cologne Web Performance Optimization Group SensioLabs Créateur du framework Symfony
  • 2. Dennis Benkert • @denderello • Sensio Labs Deutschland • Software Developer • symfony 1.x & Symfony2 • Cloud Architekturen SensioLabs 2 Créateur du framework Symfony
  • 4. HTTP Caching 4 http://www.flickr.com/photos/michelkuik/161160973/
  • 5. SensioLabs 5 Créateur du framework Symfony
  • 6. ~500 ms ~100 ms SensioLabs 6 Créateur du framework Symfony
  • 7. ~200 ms ~100 ms SensioLabs 7 Créateur du framework Symfony
  • 8. Doppelte Generierung vermeiden 8 http://www.flickr.com/photos/donaldmacleod/3439612846/
  • 9. Reverse Proxy SensioLabs 9 Créateur du framework Symfony
  • 10. HTTP Headers FTW! 10 http://www.flickr.com/photos/trentstrohm/205858578/
  • 11. GET / HTTP/1.1 Host: http://example.com GET/HTTP/1.1Host:http.trainings.sensiolabs.com SensioLabs 11 Créateur du framework Symfony
  • 12. HTTP/1.1 200 OK Date: Wed, 15 Oct 2005 07:07:07 GMT Server: Apache Content-Length: 14 Content-Type: text/html GET/HTTP/1.1Host:http.trainings.sensiolabs.com HelloWorld! SensioLabs 12 Créateur du framework Symfony
  • 13. HTTP Expiration SensioLabs 13 Créateur du framework Symfony
  • 14. HTTP/1.1 200 OK … Cache--Control: s-­­maxage=10 HelloWorld! GET/HTTP/1.1Host:http.trainings.sensiolabs.com SensioLabs 14 Créateur du framework Symfony
  • 15. HTTP/1.1 Reverse Client App 200 OK Proxy SensioLabs 15 Créateur du framework Symfony
  • 16. HTTP/1.1 Reverse Client App 200 OK Proxy SensioLabs 16 Créateur du framework Symfony
  • 17. HTTP Validation SensioLabs 17 Créateur du framework Symfony
  • 18. HTTP/1.1 200 OK … Last-Modified: Thu 15 Oct 2005 07:00 … HelloWorld! GET/HTTP/1.1Host:http.trainings.sensiolabs.com SensioLabs 18 Créateur du framework Symfony
  • 19. HTTP/1.1 Reverse Client App 200 OK Proxy HTTP/1.1 Last-Modified SensioLabs 19 Créateur du framework Symfony
  • 20. HTTP/1.1 Reverse Client App 304 Not Modified Proxy HTTP/1.1 304 Not Modified SensioLabs 20 Créateur du framework Symfony
  • 21. REVERSE PROXY CACHE SURROGATE CACHE GATEWAY CACHE HTTP ACCELERATOR SensioLabs 21 Créateur du framework Symfony
  • 23. Varnish • HTTP accelerator (Webbeschleuniger) • Programmiert in C • Stark Thread-basiert • Gutes Speichermanagement • Eigene Konfigurationssprache • ESI Support SensioLabs 23 Créateur du framework Symfony
  • 24. Varnish Configuration Language VCL SensioLabs 24 Créateur du framework Symfony
  • 25. backend default { .host = "192.168.0.10"; .port = "8080"; } GET/HTTP/1.1Host:http.trainings.sensiolabs.com SensioLabs 25 Créateur du framework Symfony
  • 26. Backend? SensioLabs 26 Créateur du framework Symfony
  • 27. Backend Varnish SensioLabs 27 Créateur du framework Symfony
  • 28. Varnish Backend SensioLabs 28 Créateur du framework Symfony
  • 29. backend default { .host = "192.168.0.1"; .port = "8080"; } GET/HTTP/1.1Host:http.trainings.sensiolabs.com backend images { .host = "192.168.0.2"; .port = "8080"; } SensioLabs 29 Créateur du framework Symfony
  • 30. sub vcl_recv { setreq.backend = app; if(req.url ~ ".(gif|jpg)$") { setreq.backend = images; } GET/HTTP/1.1Host:http.trainings.sensiolabs.com } SensioLabs 30 Créateur du framework Symfony
  • 31. sub?! SensioLabs 31 Créateur du framework Symfony
  • 32. vcl_recv?!!111 SensioLabs 32 Créateur du framework Symfony
  • 33. Varnish Subroutines SensioLabs 33 Créateur du framework Symfony
  • 34. Miss SensioLabs 34 Créateur du framework Symfony
  • 35. Request vcl_recv vcl_hash Cached? vcl_miss Response vcl_deliver vcl_fetch SensioLabs 35 Créateur du framework Symfony
  • 36. Hit SensioLabs 36 Créateur du framework Symfony
  • 37. Request vcl_recv vcl_hash Cached? vcl_hit Response vcl_deliver SensioLabs 37 Créateur du framework Symfony
  • 38. Pipe SensioLabs 38 Créateur du framework Symfony
  • 39. Request vcl_recv vcl_pipe Response SensioLabs 39 Créateur du framework Symfony
  • 40. Pass SensioLabs 40 Créateur du framework Symfony
  • 41. Request vcl_recv vcl_hash Cached? vcl_pass vcl_hit vcl_miss Response vcl_deliver vcl_fetch SensioLabs 41 Créateur du framework Symfony
  • 42. Header Manipulation SensioLabs 42 Créateur du framework Symfony
  • 43. sub vcl_deliver { setresp.http.X-Cache-Hits = obj.hits; } GET/HTTP/1.1Host:http.trainings.sensiolabs.com SensioLabs 43 Créateur du framework Symfony
  • 44. HTTP/1.1 200 OK … X-Cache-Hits: 5 … GET/HTTP/1.1Host:http.trainings.sensiolabs.com SensioLabs 44 Créateur du framework Symfony
  • 45. Edge Side Includes ESI SensioLabs 45 Créateur du framework Symfony
  • 46. SensioLabs 46 Créateur du framework Symfony
  • 47. <html> <body> Some content <esi:include src="http://" /> More content GET/HTTP/1.1Host:http.trainings.sensiolabs.com </body> </html> SensioLabs 47 Créateur du framework Symfony
  • 48. SensioLabs 48 Créateur du framework Symfony
  • 49. Webseite Kompletter Reverse Client Content App Proxy ESI SensioLabs 49 Créateur du framework Symfony
  • 50. SensioLabs 50 Créateur du framework Symfony
  • 51. Webseite Reverse Client App Proxy ESI SensioLabs 51 Créateur du framework Symfony
  • 52. Und das war nur ein Ausblick… SensioLabs 52 Créateur du framework Symfony