• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
To the Edge of Web Performance and Beyond
 

To the Edge of Web Performance and Beyond

on

  • 2,156 views

An examination of ESI, who you should care and how you can use it in your Rails application.

An examination of ESI, who you should care and how you can use it in your Rails application.

Statistics

Views

Total Views
2,156
Views on SlideShare
2,148
Embed Views
8

Actions

Likes
2
Downloads
32
Comments
0

2 Embeds 8

http://www.slideshare.net 6
http://www.apurva.com 2

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    To the Edge of Web Performance and Beyond To the Edge of Web Performance and Beyond Presentation Transcript

    • 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