Assembling Pages Last: Edge Caching, ESI and Rails
-
Upload
oleksiy-kovyrin -
Category
Documents
-
view
115 -
download
2
Transcript of Assembling Pages Last: Edge Caching, ESI and Rails
![Page 1: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/1.jpg)
Aaron Batalion5/31/2008
Assembling Pages LastEdge Caching, ESI, and Rails
1
![Page 2: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/2.jpg)
2
![Page 3: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/3.jpg)
www.livingsocial.com blog.livingsocial.com
About Me
3
![Page 4: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/4.jpg)
http://rails100.pbwiki.com/
#2
About Me
www.revolution.com
4
![Page 5: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/5.jpg)
- Examine a Rails Application
- Apply Standard Caching Techniques
- When thats not enough, then what?
- Edge Caching
- FragmentFu
- Deployment Options
- Pros/Cons of Edge Caching
Agenda
5
![Page 6: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/6.jpg)
Agenda- Examine a Rails Application
- Apply Standard Caching Techniques
- When thats not enough, then what?
- Edge Caching
- FragmentFu
- Deployment Options
- Pros/Cons of Edge Caching
6
![Page 7: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/7.jpg)
7
![Page 8: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/8.jpg)
8
![Page 9: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/9.jpg)
9
![Page 10: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/10.jpg)
10
![Page 11: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/11.jpg)
11
![Page 12: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/12.jpg)
12
![Page 13: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/13.jpg)
13
![Page 15: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/15.jpg)
def show @feed = @person.mini_feed @current = @person.currently_reading @news = Blog.recent_by_vertical(“readingsocial”)end
15
![Page 16: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/16.jpg)
<html> <%= render :partial => "header/login" -%> <%= render :partial => "feed" -%> <%= render :partial => "current" -%> <%= render :partial => "news" -%></html>
16
![Page 17: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/17.jpg)
When thats not enough, then what?
17
![Page 18: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/18.jpg)
When thats not enough, then what?
18
![Page 19: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/19.jpg)
When thats not enough, then what?
19
![Page 20: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/20.jpg)
Agenda- Examine a Rails Application
- Apply Standard Caching Techniques
- When thats not enough, then what?
- Edge Caching
- FragmentFu
- Deployment Options
- Pros/Cons of Edge Caching
20
![Page 21: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/21.jpg)
class PeopleController caches_page :show ...end
21
![Page 22: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/22.jpg)
class PeopleController caches_page :show ...end
22
![Page 23: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/23.jpg)
class PeopleController caches_action :show ...end
23
![Page 24: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/24.jpg)
class PeopleController caches_action :show ...end
24
![Page 25: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/25.jpg)
<% cache(“mini-feed-#{@person.id}”) do %> <% @feed = @person.mini_feed %> <%= render :partial => "feed" -%><% end %>
25
![Page 26: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/26.jpg)
class Person def mini_feed cache(“feed-#{id}”) { ...} endend
26
![Page 27: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/27.jpg)
When thats not enough, then what?
When thats not enough....
27
![Page 28: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/28.jpg)
28
![Page 29: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/29.jpg)
Rails isn’t fast....
It is fast enough
You can always get
LOTS and LOTS of servers...
29
![Page 30: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/30.jpg)
Use your application
Without hitting your application
30
![Page 31: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/31.jpg)
HTTP/1.1 200 OKDate: Fri, 15 Dec 2007 17:32:47 GMTContent-Length: 33286Cache-Control: max-age=7200Content-Type: text/html
31
![Page 32: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/32.jpg)
HTTP/1.1 200 OKDate: Fri, 15 Dec 2007 17:32:47 GMTContent-Length: 33286Cache-Control: max-age=7200Content-Type: text/html
32
![Page 33: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/33.jpg)
Agenda- Examine a Rails Application
- Apply Standard Caching Techniques
- When thats not enough, then what?
- Edge Caching
- FragmentFu
- Deployment Options
- Pros/Cons of Edge Caching
33
![Page 34: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/34.jpg)
ESIEdge Side Includes
2001 W3C Spechttp://www.w3.org/TR/esi-lang
By: Akamai, Oracle, BEA, Vignette...
34
![Page 35: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/35.jpg)
simple markup languageesi:include esi:try esi:attempt esi:except esi:invalidate HTTP_* esi:chose esi:when
35
![Page 36: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/36.jpg)
parsed by ESI server
36
![Page 37: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/37.jpg)
Mongrel
Mongrel
Mongrel
ESI Server
1. http://readers.livingsocial.com2. Page Template
http://readers.livingsocial.com
html + esi
37
![Page 38: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/38.jpg)
“Assembles”
4 /header (ttl = 60.min)
1/mini_feed (ttl = 30.min)
2/recent (ttl = 10.min)
3/news (ttl = 60.min)
<html> .......
<esi:include src="/mini_feed” max-age="1800"/> .......
</html>
38
![Page 39: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/39.jpg)
Mongrel
Mongrel
Mongrel
ESI Server
1. http://readers.livingsocial.com2. Page Template (if not cached)3. Retrieve Fragments (if not cached)
http://readers.livingsocial.com html + esi
html
39
![Page 40: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/40.jpg)
1. http://readers.livingsocial.com
40
![Page 41: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/41.jpg)
1. http://readers.livingsocial.com2. Page Template (if not cached)
41
![Page 42: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/42.jpg)
4 /header (ttl = 60.min)
1/mini_feed (ttl = 30.min)
2/recent (ttl = 10.min)
3/news (ttl = 60.min)
1. http://readers.livingsocial.com2. Page Template (if not cached)
42
![Page 43: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/43.jpg)
4
12
31. http://readers.livingsocial.com2. Page Template (if not cached)3. Retrieve Fragments (if not cached)
43
![Page 44: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/44.jpg)
“Assembles”
1. http://readers.livingsocial.com2. Page Template (if not cached)3. Retrieve Fragments (if not cached)4. Respond back to User
44
![Page 45: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/45.jpg)
http://readers.livingsocial.com1. http://readers.livingsocial.com2. Page Template (cached)
45
![Page 46: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/46.jpg)
“Assembles”
4
12
31. http://readers.livingsocial.com2. Page Template (cached)3. Retrieve Fragments (cached)4. Respond back to User
46
![Page 47: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/47.jpg)
“Assembles”
4
12
31. http://readers.livingsocial.com (cached)2. Page Template (cached)3. Retrieve Fragments (3 is cached)4. Respond back to User
47
![Page 48: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/48.jpg)
So what!
Memcache can do that!
48
![Page 49: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/49.jpg)
ESIESI: Personalized Full Page Caching ESI: ConcurrencyESI: Slow/Broken Dependencies ESI: Application ShardingESI: Polyglot Assembly ESI: Inline Invalidation ESI: Cached New User Experience
49
![Page 50: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/50.jpg)
ESI: Personalized Full Page Caching caches_page
cache(“whole_page”) {...}
headers[“Cache-Control”] = “max-age:3600”
50
![Page 51: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/51.jpg)
ESI: Concurrency
def show @feed = @person.mini_feed @current = @person.currently_reading @news = Blog.recent_by_vertical(“readingsocial”) end
51
![Page 52: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/52.jpg)
ESI: Concurrency
def show @feed = @person.mini_feed # 1s @current = @person.currently_reading # 1s @news = Blog.recent_by_vertical(“readingsocial”) # 1s end
3s
52
![Page 53: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/53.jpg)
ESI: Concurrency
def mini_feed #1s ...def currently_reading #1s ...
def news #1s 3s -> 1s ...
53
![Page 54: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/54.jpg)
ESI: Slow/Broken Dependencies
def show @feed = @person.mini_feed @current = @person.currently_reading @news = Blog.recent_by_vertical(“reading”) #10send
54
![Page 55: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/55.jpg)
ESI: Slow/Broken Dependencies
<esi:include src=”/mini_feed” max-age=”600”/>
55
![Page 56: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/56.jpg)
ESI: Slow/Broken Dependencies
<esi:try> <esi:attempt> <esi:include src=”/mini_feed” max-age=”600” timeout=”1”/> </esi:attempt> <esi:except> <esi:include src=”/static/mini_feed.html”/> </esi:except></esi:try>
56
![Page 57: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/57.jpg)
ESI: Application Sharding
“Federate as much as you can”
“A rails process should only
be doing one controller”
57
![Page 58: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/58.jpg)
ESI: Application Sharding
/mini_feed
58
![Page 59: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/59.jpg)
ESI: Polyglot Assembly
/mini_feed
Merb/Erlang
59
![Page 60: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/60.jpg)
ESI: Cached New User Experience
1/mini_feed (ttl = 30.min)
2/recent (ttl =
10.min)
3/news (ttl =
60.min)
4
60
![Page 61: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/61.jpg)
ESI: Cached New User Experience
1/mini_feed (ttl = 30.min)
2/recent (ttl =
10.min)
3/news (ttl =
60.min)
4
”/mini_feed?uid=$HTTP_COOKIE[“uid”]”
61
![Page 62: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/62.jpg)
ESI:Cached New User Experience
1/mini_feed (ttl = 30.min)
2/recent (ttl =
3/news (ttl =
60.min)
4
”/mini_feed?uid=” Full Cache Hit!
62
![Page 63: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/63.jpg)
ESI: Inline Invalidation
<esi:invalidate> .... <basicselector uri="/foo/bar/baz"/> ... <advancedselector uriexp="/people/123/.*"/></esi:invalidate>
63
![Page 64: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/64.jpg)
Agenda- Examine a Rails Application
- Apply Standard Caching Techniques
- When thats not enough, then what?
- Edge Caching
- FragmentFu
- Deployment Options
- Pros/Cons of Edge Caching
64
![Page 65: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/65.jpg)
FragmentFu
Project: http://code.google.com/p/mongrel-esi/google: FragmentFu
“Proof of Concept”
65
![Page 66: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/66.jpg)
<%= render :esi => fragment_person_path, :ttl => 60.minutes %>
FragmentFu
66
![Page 67: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/67.jpg)
def update .... invalidate_and_redirect_to(person_path(@person))end
FragmentFu
67
![Page 68: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/68.jpg)
def latest ... respond_to |wants| do wants.html { ... } wants.js { ... } #X-Requested-With = 'XMLHttpRequest' endend
FragmentFu
68
![Page 69: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/69.jpg)
def latest ... respond_to |wants| do wants.html { ... } wants.js { ... } #X-Requested-With = 'XMLHttpRequest' wants.fragment { .... } #X-Requested-With = ʻESIRequest' endend
FragmentFu
69
![Page 70: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/70.jpg)
Agenda- Examine a Rails Application
- Apply Standard Caching Techniques
- When thats not enough, then what?
- Edge Caching
- FragmentFu
- Deployment Options
- Pros/Cons of Edge Caching
70
![Page 71: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/71.jpg)
- Open Source
- Commerical
- Content Delivery Network
71
![Page 72: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/72.jpg)
mongrel-esi http://code.google.com/p/mongrel-esi/
- Small, but fast
- Open Source by Todd Fisher
- Ragel based parser
- memcache-backed caching
72
![Page 73: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/73.jpg)
Squid http://www.squid-cache.org/
- In 2002, Zope funded ESI
- Version 3.0+
- subset of ESI support
73
![Page 74: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/74.jpg)
Varnish http://varnish.projects.linpro.no/
- Supposedly Fast “Squid is rather old and designed like computer programs where supposed to be designed in 1980.” - Varnish FAQ
- basic ESI support
- FunnyOrDie.com uses
74
![Page 75: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/75.jpg)
Varnish http://www.funnyordie.com/
- Supposedly Fast“Squid is rather old and designed like computer programs where supposed to be designed in 1980.”
http://varnish.projects.linpro.no/wiki/FAQ
- subset of ESI support
- FunnyOrDie.com uses56.6M views
75
![Page 76: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/76.jpg)
Web Cache 10g
B BIG-IP WebAccelerator
76
![Page 77: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/77.jpg)
Web Cache 10g 2007 InfoQ Article - RevolutionHealth.com http://www.infoq.com/news/2007/02/revolution-health-profile
“NetCraft says you've got Oracle Application Server 10g as the final public facing piece... “
77
![Page 78: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/78.jpg)
Akamai
Most Complete ESI Implementation
78
![Page 79: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/79.jpg)
Agenda- Examine a Rails Application
- Apply Standard Caching Techniques
- When thats not enough, then what?
- Edge Caching
- FragmentFu
- Deployment Options
- Pros/Cons of Edge Caching
79
![Page 80: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/80.jpg)
YAGNI
Edge Caching - Cons
80
![Page 81: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/81.jpg)
complexity
Edge Caching - Cons
81
![Page 82: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/82.jpg)
cache
invalidation
Edge Caching - Cons
82
![Page 83: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/83.jpg)
“There are only two hard things in
Computer Science: cache invalidation
and naming things”
- Phil Karlton
Edge Caching - Cons
83
![Page 84: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/84.jpg)
lack of mature
open source
Edge Caching - Cons
84
![Page 85: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/85.jpg)
cost of
deployment
Edge Caching - Cons
85
![Page 86: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/86.jpg)
concurrent execution
Edge Caching - Pros
86
![Page 87: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/87.jpg)
efficient execution
Edge Caching - Pros
87
![Page 88: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/88.jpg)
A/B
Testing
Edge Caching - Pros
88
![Page 89: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/89.jpg)
RESTfulapplication
assembly
Edge Caching - Pros
def mini_feed ...def currently_reading ...def news ...
89
![Page 90: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/90.jpg)
Syndication for
Free
Edge Caching - Pros
90
![Page 91: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/91.jpg)
Geographically
Distributed
Personalization
Edge Caching - Pros
91
![Page 92: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/92.jpg)
92
![Page 93: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/93.jpg)
flickr.com/photos/nickdawson/1484934955
flickr.com/photos/kamonegi_jp/1860174314
flickr.com/photos/mdd/175287890
flickr.com/photos/caseywilliamson/82417809
flickr.com/photos/zeemanshuis/1351045987
flickr.com/photos/petestott/1281698980
flickr.com/photos/bunchofpants/103515576/
flickr.com/photos/seikatsu/686399884/
flickr.com/photos/hand-nor-glove/2311353113
flickr.com/photos/scobleizer/2341031948/
http://blog.hungrymachine.com
93
![Page 94: Assembling Pages Last: Edge Caching, ESI and Rails](https://reader033.fdocuments.in/reader033/viewer/2022051609/54638167b1af9ffd2a8b4630/html5/thumbnails/94.jpg)
Q&A
94