SlideShare a Scribd company logo
Drupal, varnish, esi - Toulouse November 2
Marcus Deglos
@manarth
#cdl2011
Drupal, varnish, esi - Toulouse November 2
> Old
           faithful, serving
           sites since 1996.
         > Quick
         > Simple
Apache
Apache's model


             Web server
Apache's model with PHP


                      Web server




               PHP engine
Do it with Drupal


                   Web server
                                  DB


                                index.php


            PHP engine
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"

"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html

                        Example HTML
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" version="XHTML+RDFa 1.0" dir="ltr"

xmlns:content="http://purl.org/rss/1.0/modules/content/"

xmlns:dc="http://purl.org/dc/terms/"
 xmlns:foaf="http://xmlns.com/foaf/0.1/"

xmlns:og="http://ogp.me/ns#"
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

xmlns:sioc="http://rdfs.org/sioc/ns#"
 xmlns:sioct="http://rdfs.org/sioc/types#"

xmlns:skos="http://www.w3.org/2004/02/skos/core#"

xmlns:xsd="http://www.w3.org/2001/XMLSchema#">

<head
profile="http://www.w3.org/1999/xhtml/vocab">
 <meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<link rel="shortcut icon"
href="http://testbed.local/misc/favicon.ico" type="image/vnd.microsoft.icon" />
<meta
name="Generator" content="Drupal 7 (http://drupal.org)" />
 <title>Welcome to Site-Install |
Site-Install</title>




                HTML from homepage after
                          running drushsi
Drag race results
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
> Prepared in
          advance
        > Typically uses a
          build-script
        > Produces static
          pages
        > Quick
        > No complex
          behaviour
        > Boost module is an
Baked     example
> Pages created on
  the fly
> CMS or other
  complex dynamic
  system
> Allows complex
  behaviour
> Drupal does this
> Slow
                     Fried
Drupal, varnish, esi - Toulouse November 2
> Software
                     package
                     (daemon) for
                     linux
                   > Reverse proxy,
                     such as Squid,
                     Nginx and Zeus
What is Varnish?   > Cache
How Varnish works
   GET /blog
   Host   deglos.com
   User-AgentMozilla/5.0 (Macintosh; Intel
   Mac OS X 10.6; rv:8.0.1) Gecko/20100101
   Firefox/8.0.1
   Accept
      text/html,application/xhtml+xml,applic
   ation/xml;q=0.9,*/*;q=0.8
   Varnish                Drupal
   Accept-Language en-us,en;q=0.5
   Accept-Encoding gzip, deflate
   Accept-Charset    ISO-8859-1,utf-
   8;q=0.7,*;q=0.7
   Connectionkeep-alive
Varnish is slower
  If Varnish passes every request to Drupal
  – and acts just as a MITM – your site will
  be slower.



  Varnish               Drupal
Varnish needs to cache



     Varnish           Drupal




               Cache
Varnish + cache is quicker
   10x faster
   (or more)



          Varnish           Drupal




                    Cache
Personalisation is a problem



        Varnish           Drupal




                  Cache
The Uncacheable



  Varnish           Drupal




            Cache
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Example VCL:
#This is a basic VCL configuration file for
  varnish.
backend default {
  .host = "127.0.0.1";
  .port = "80";
}

sub vcl_fetch {
  unset obj.http.Cache-Control;
  unset obj.http.Expires;
  set obj.ttl = 86400s;
}
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
vcl.list
telnet localhost6082
Trying ::1...
Connected to localhost.
Escape character is '^]'.
vcl.list
200 23
active          1 boot
help
telnet localhost6082
Trying ::1...
Connected to localhost.
Escape character is '^]'.
help
200 376
help [command]
ping [timestamp]
status
start
stop
stats
...
url.purge
telnet localhost6082
Trying ::1...
Connected to localhost.
Escape character is '^]'.
url.purge .*
200 0
Drupal, varnish, esi - Toulouse November 2
Setting up Varnish
> Download varnish daemon
  debian: apt-get install varnish
  redhat:yum install varnish
> Re-configure Apache to listen on port 8080
  (or other non-standard port)
> Configure Varnish to listen on port 80
> Configure Varnish VCL to connect to
  Apache
> VCL tweaks (default does not cache
  Drupal)
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Serving ESIs



Varnish           Drupal




          Cache
Serving ESIs



Varnish           Drupal




          Cache
Serving ESIs
<div id="nav-masthead" class="grid-12">
<ul>
<li class="homepage active first active">
<a href="/home" class="active active">Drupal Homepage</a>
</li>
<li class="dashboard last">
<a href="/user/dashboard">Your Dashboard</a>
</li>
</ul>                   Varnish                      Drupal
<div id="userinfo">
<a href="/user" title="View &amp; edit your user profile">Logged in as
manarth</a>
<a href="/logout">Log out</a>
</div>
</div><!-- /#nav-masthead -->            Cache
Serving ESIs
<div id="nav-masthead" class="grid-12">
<ul>
<li class="homepage active first active">
<a href="/home" class="active active">Drupal Homepage</a>
</li>
<li class="dashboard last">
<a href="/user/dashboard">Your Dashboard</a>
</li>
</ul>                 Varnish                 Drupal
<esisrc="http://example.com/esi/userinfo" />




</div><!-- /#nav-masthead -->     Cache
Serving ESIs

<div id="userinfo">
<a href="/user" title="View &amp; edit your user profile">Logged in
as manarth</a>
<a href="/logout">Log out</a>
</div>
                 Varnish                     Drupal




                                  Cache
What do you need in order to do
             ESIs?
> Replace personalisationwith ESI tags
  Theme-alters?
> Provide backend hook_menuhandlers for
  each ESI tag
> Ensure that Varnish is caching
> Rule 35 applies
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Configuring ESI Blocks
Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Flickr Credits
> Babbage engine
  http://www.flickr.com/photos/melgart/4444251
  225
> Cookies
  http://www.flickr.com/photos/sabine01/24855
  02578
> Frying wok
  http://www.flickr.com/photos/18403292@N00/
  3048993
> Varnish
  http://www.flickr.com/photos/dawniecakes/46
  86467791
Drupal, varnish, esi - Toulouse November 2

More Related Content

PPTX
Performance all teh things
Marcus Deglos
 
PPT
Speeding Up The Snail
Marcus Deglos
 
PPTX
Varnish bof
Marcus Deglos
 
PDF
Drupal feature proposal: two new stream-wrappers
Marcus Deglos
 
PPTX
Varnish intro
Boyan Borisov
 
PDF
Caching with Varnish
schoefmax
 
PDF
Varnish Configuration Step by Step
Kim Stefan Lindholm
 
PDF
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
Luis Rodríguez Castromil
 
Performance all teh things
Marcus Deglos
 
Speeding Up The Snail
Marcus Deglos
 
Varnish bof
Marcus Deglos
 
Drupal feature proposal: two new stream-wrappers
Marcus Deglos
 
Varnish intro
Boyan Borisov
 
Caching with Varnish
schoefmax
 
Varnish Configuration Step by Step
Kim Stefan Lindholm
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
Luis Rodríguez Castromil
 

What's hot (20)

ODP
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
aaroncouch
 
PDF
Varnish - PLNOG 4
Leszek Urbanski
 
PPTX
Dockerizing WordPress
dotCloud
 
PPTX
HBaseConEast2016: HBase on Docker with Clusterdock
Michael Stack
 
ODP
The secret life of a dispatcher (Adobe CQ AEM)
Venugopal Gummadala
 
PPT
Roy foubister (hosting high traffic sites on a tight budget)
WordCamp Cape Town
 
PPTX
Apache Performance Tuning: Scaling Up
Sander Temme
 
PPTX
Magento 2 Workflows
Ryan Street
 
PPT
Apache Web Server Setup 1
Information Technology
 
PPTX
cache concepts and varnish-cache
Marc Cortinas Val
 
PDF
Web agencies: An analysis of the OVH infrastructure to optimise your web proj...
OVHcloud
 
PPTX
Using memcache to improve php performance
Sudar Muthu
 
PPT
Apache Web Server Setup 4
Information Technology
 
PPT
Apache web server installation/configuration, Virtual Hosting
webhostingguy
 
PPTX
Web server installation_configuration_apache
Shaojie Yang
 
PPT
Develop with linux containers and docker
Fabio Fumarola
 
PPTX
Corley scalability
Corley S.r.l.
 
PDF
Aem dispatcher – tips & tricks
Ashokkumar T A
 
PPTX
HBaseConEast2016: Practical Kerberos with Apache HBase
Michael Stack
 
PPT
Architecting cloud
Tahsin Hasan
 
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
aaroncouch
 
Varnish - PLNOG 4
Leszek Urbanski
 
Dockerizing WordPress
dotCloud
 
HBaseConEast2016: HBase on Docker with Clusterdock
Michael Stack
 
The secret life of a dispatcher (Adobe CQ AEM)
Venugopal Gummadala
 
Roy foubister (hosting high traffic sites on a tight budget)
WordCamp Cape Town
 
Apache Performance Tuning: Scaling Up
Sander Temme
 
Magento 2 Workflows
Ryan Street
 
Apache Web Server Setup 1
Information Technology
 
cache concepts and varnish-cache
Marc Cortinas Val
 
Web agencies: An analysis of the OVH infrastructure to optimise your web proj...
OVHcloud
 
Using memcache to improve php performance
Sudar Muthu
 
Apache Web Server Setup 4
Information Technology
 
Apache web server installation/configuration, Virtual Hosting
webhostingguy
 
Web server installation_configuration_apache
Shaojie Yang
 
Develop with linux containers and docker
Fabio Fumarola
 
Corley scalability
Corley S.r.l.
 
Aem dispatcher – tips & tricks
Ashokkumar T A
 
HBaseConEast2016: Practical Kerberos with Apache HBase
Michael Stack
 
Architecting cloud
Tahsin Hasan
 
Ad

Similar to Drupal, varnish, esi - Toulouse November 2 (20)

PPT
Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...
Acquia
 
PDF
Varnish Cache
Mahbub E Elahi (Ron)
 
PDF
High Performance Drupal Sites
Abayomi Ayoola
 
PDF
Cache all the things - A guide to caching Drupal
digital006
 
PDF
Saving The World From Guaranteed APOCALYPSE* Using Varnish and Memcached
georgepenkov
 
PDF
VUG5: Varnish at Opera Software
Cosimo Streppone
 
PPTX
Designing enterprise drupal
Jason Burnett
 
PDF
DRUPAL CACHE SYSTEMS AND VARNISH
Drupal Portugal
 
PPTX
Pure Speed Drupal 4 Gov talk
Bryan Ollendyke
 
PDF
Supercharging Content Delivery with Varnish
Samantha Quiñones
 
PDF
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
How we use and deploy Varnish at Opera
Cosimo Streppone
 
PPT
Drupalcamp Estonia - High Performance Sites
Exove
 
PPT
Drupalcamp Estonia - High Performance Sites
drupalcampest
 
ODP
PHP London Dec 2013 - Varnish - The 9 circles of hell
luis-ferro
 
PDF
Scalable Architecture 101
ConFoo
 
KEY
Drupal High Availability High Performance 2012
Amazee Labs
 
PDF
Varnish
Joshua Estes
 
PDF
PLNOG 4: Leszek Urbański - A modern HTTP accelerator for content providers
PROIDEA
 
KEY
Varnish @ Velocity Ignite
Artur Bergman
 
Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...
Acquia
 
Varnish Cache
Mahbub E Elahi (Ron)
 
High Performance Drupal Sites
Abayomi Ayoola
 
Cache all the things - A guide to caching Drupal
digital006
 
Saving The World From Guaranteed APOCALYPSE* Using Varnish and Memcached
georgepenkov
 
VUG5: Varnish at Opera Software
Cosimo Streppone
 
Designing enterprise drupal
Jason Burnett
 
DRUPAL CACHE SYSTEMS AND VARNISH
Drupal Portugal
 
Pure Speed Drupal 4 Gov talk
Bryan Ollendyke
 
Supercharging Content Delivery with Varnish
Samantha Quiñones
 
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
How we use and deploy Varnish at Opera
Cosimo Streppone
 
Drupalcamp Estonia - High Performance Sites
Exove
 
Drupalcamp Estonia - High Performance Sites
drupalcampest
 
PHP London Dec 2013 - Varnish - The 9 circles of hell
luis-ferro
 
Scalable Architecture 101
ConFoo
 
Drupal High Availability High Performance 2012
Amazee Labs
 
Varnish
Joshua Estes
 
PLNOG 4: Leszek Urbański - A modern HTTP accelerator for content providers
PROIDEA
 
Varnish @ Velocity Ignite
Artur Bergman
 
Ad

More from Marcus Deglos (6)

PPTX
Vagrant crash course
Marcus Deglos
 
PPTX
Drupal haters gonna hate
Marcus Deglos
 
PPTX
With one click
Marcus Deglos
 
PPTX
Panels rocks!
Marcus Deglos
 
PDF
SSO To go
Marcus Deglos
 
PPTX
Where in the world
Marcus Deglos
 
Vagrant crash course
Marcus Deglos
 
Drupal haters gonna hate
Marcus Deglos
 
With one click
Marcus Deglos
 
Panels rocks!
Marcus Deglos
 
SSO To go
Marcus Deglos
 
Where in the world
Marcus Deglos
 

Recently uploaded (20)

PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 

Drupal, varnish, esi - Toulouse November 2

  • 4. > Old faithful, serving sites since 1996. > Quick > Simple Apache
  • 5. Apache's model Web server
  • 6. Apache's model with PHP Web server PHP engine
  • 7. Do it with Drupal Web server DB index.php PHP engine
  • 8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
 "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html Example HTML xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" version="XHTML+RDFa 1.0" dir="ltr"
 xmlns:content="http://purl.org/rss/1.0/modules/content/"
 xmlns:dc="http://purl.org/dc/terms/"
 xmlns:foaf="http://xmlns.com/foaf/0.1/"
 xmlns:og="http://ogp.me/ns#"
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
 xmlns:sioc="http://rdfs.org/sioc/ns#"
 xmlns:sioct="http://rdfs.org/sioc/types#"
 xmlns:skos="http://www.w3.org/2004/02/skos/core#"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema#">

<head profile="http://www.w3.org/1999/xhtml/vocab">
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="http://testbed.local/misc/favicon.ico" type="image/vnd.microsoft.icon" />
<meta name="Generator" content="Drupal 7 (http://drupal.org)" />
 <title>Welcome to Site-Install | Site-Install</title> HTML from homepage after running drushsi
  • 13. > Prepared in advance > Typically uses a build-script > Produces static pages > Quick > No complex behaviour > Boost module is an Baked example
  • 14. > Pages created on the fly > CMS or other complex dynamic system > Allows complex behaviour > Drupal does this > Slow Fried
  • 16. > Software package (daemon) for linux > Reverse proxy, such as Squid, Nginx and Zeus What is Varnish? > Cache
  • 17. How Varnish works GET /blog Host deglos.com User-AgentMozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0.1) Gecko/20100101 Firefox/8.0.1 Accept text/html,application/xhtml+xml,applic ation/xml;q=0.9,*/*;q=0.8 Varnish Drupal Accept-Language en-us,en;q=0.5 Accept-Encoding gzip, deflate Accept-Charset ISO-8859-1,utf- 8;q=0.7,*;q=0.7 Connectionkeep-alive
  • 18. Varnish is slower If Varnish passes every request to Drupal – and acts just as a MITM – your site will be slower. Varnish Drupal
  • 19. Varnish needs to cache Varnish Drupal Cache
  • 20. Varnish + cache is quicker 10x faster (or more) Varnish Drupal Cache
  • 21. Personalisation is a problem Varnish Drupal Cache
  • 22. The Uncacheable Varnish Drupal Cache
  • 27. Example VCL: #This is a basic VCL configuration file for varnish. backend default { .host = "127.0.0.1"; .port = "80"; } sub vcl_fetch { unset obj.http.Cache-Control; unset obj.http.Expires; set obj.ttl = 86400s; }
  • 30. vcl.list telnet localhost6082 Trying ::1... Connected to localhost. Escape character is '^]'. vcl.list 200 23 active 1 boot
  • 31. help telnet localhost6082 Trying ::1... Connected to localhost. Escape character is '^]'. help 200 376 help [command] ping [timestamp] status start stop stats ...
  • 32. url.purge telnet localhost6082 Trying ::1... Connected to localhost. Escape character is '^]'. url.purge .* 200 0
  • 34. Setting up Varnish > Download varnish daemon debian: apt-get install varnish redhat:yum install varnish > Re-configure Apache to listen on port 8080 (or other non-standard port) > Configure Varnish to listen on port 80 > Configure Varnish VCL to connect to Apache > VCL tweaks (default does not cache Drupal)
  • 37. Serving ESIs Varnish Drupal Cache
  • 38. Serving ESIs Varnish Drupal Cache
  • 39. Serving ESIs <div id="nav-masthead" class="grid-12"> <ul> <li class="homepage active first active"> <a href="/home" class="active active">Drupal Homepage</a> </li> <li class="dashboard last"> <a href="/user/dashboard">Your Dashboard</a> </li> </ul> Varnish Drupal <div id="userinfo"> <a href="/user" title="View &amp; edit your user profile">Logged in as manarth</a> <a href="/logout">Log out</a> </div> </div><!-- /#nav-masthead --> Cache
  • 40. Serving ESIs <div id="nav-masthead" class="grid-12"> <ul> <li class="homepage active first active"> <a href="/home" class="active active">Drupal Homepage</a> </li> <li class="dashboard last"> <a href="/user/dashboard">Your Dashboard</a> </li> </ul> Varnish Drupal <esisrc="http://example.com/esi/userinfo" /> </div><!-- /#nav-masthead --> Cache
  • 41. Serving ESIs <div id="userinfo"> <a href="/user" title="View &amp; edit your user profile">Logged in as manarth</a> <a href="/logout">Log out</a> </div> Varnish Drupal Cache
  • 42. What do you need in order to do ESIs? > Replace personalisationwith ESI tags Theme-alters? > Provide backend hook_menuhandlers for each ESI tag > Ensure that Varnish is caching > Rule 35 applies
  • 52. Flickr Credits > Babbage engine http://www.flickr.com/photos/melgart/4444251 225 > Cookies http://www.flickr.com/photos/sabine01/24855 02578 > Frying wok http://www.flickr.com/photos/18403292@N00/ 3048993 > Varnish http://www.flickr.com/photos/dawniecakes/46 86467791

Editor's Notes

  • #4: Back, to the dawn of the internet, when email was in fidonet and 56k modems were all the rage.
  • #6: Add animation through the tubes.Dries makes requestGoes through internetHits serverHanded to apacheApache looks up from diskMight add some headersReturns the fileDodges the lolcat on the way back
  • #7: Add animation through the tubes.Dries makes requestGoes through internetHits serverHanded to apacheApache recognises it&apos;s .php and passes to ModPHP straight awayModPHP looks up from diskHands to lexical parserProcessesReturns the file to apacheDodges the lolcat on the way back
  • #8: Add animation through the tubes.Dries makes requestGoes through internetHits serverHanded to apacheApache processes .htaccess rulesEvery URL is index.phpPassed to ModPHP straight awayModPHP looks up from diskHands to lexical parserProcesses, invokes Drupal bootstrapReturns the file to apacheDodges the lolcat on the way back
  • #9: Benchmark:ApachePlain old PHP handler (no processing)Drupal
  • #10: Benchmark:ApachePlain old PHP handler (no processing)DrupalPHP parser adds 20%
  • #12: Refer to concepts such as baked vs fried
  • #13: Baked or fried?
  • #14: Prepared in advance No personalisation (more choc chips) Ready to eat
  • #15: One serving cooked at a time Wait a bit longer to eat Cooked freshPersonalised to taste
  • #50: - Looks at the hook_block information and uses appropriate cache rules – per user, etc.