mongrel_esi 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +10 -9
- data/doc/rdoc/classes/ESI/Cache.html +10 -10
- data/doc/rdoc/classes/ESI/Cache.src/{M000085.html → M000087.html} +0 -0
- data/doc/rdoc/classes/ESI/Cache.src/{M000086.html → M000088.html} +0 -0
- data/doc/rdoc/classes/ESI/Config.html +43 -62
- data/doc/rdoc/classes/ESI/Config.src/M000049.html +18 -0
- data/doc/rdoc/classes/ESI/Config.src/{M000059.html → M000050.html} +5 -5
- data/doc/rdoc/classes/ESI/Config.src/M000051.html +35 -0
- data/doc/rdoc/classes/ESI/Config.src/M000052.html +27 -5
- data/doc/rdoc/classes/ESI/Config.src/M000053.html +10 -5
- data/doc/rdoc/classes/ESI/Config.src/M000054.html +5 -22
- data/doc/rdoc/classes/ESI/Config.src/M000055.html +7 -25
- data/doc/rdoc/classes/ESI/Config.src/M000056.html +11 -10
- data/doc/rdoc/classes/ESI/Config/CacheConfig.html +25 -25
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/{M000068.html → M000060.html} +6 -5
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/{M000065.html → M000061.html} +5 -5
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/{M000066.html → M000062.html} +4 -4
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/{M000067.html → M000063.html} +4 -4
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000064.html +5 -6
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.html +15 -15
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/{M000061.html → M000057.html} +5 -5
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/{M000062.html → M000058.html} +7 -7
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/{M000063.html → M000059.html} +7 -7
- data/doc/rdoc/classes/ESI/Dispatcher.html +17 -15
- data/doc/rdoc/classes/ESI/Dispatcher.src/{M000087.html → M000092.html} +4 -7
- data/doc/rdoc/classes/ESI/Dispatcher.src/M000093.html +27 -0
- data/doc/rdoc/classes/ESI/Fragment.html +15 -15
- data/doc/rdoc/classes/ESI/Fragment.src/{M000100.html → M000111.html} +0 -0
- data/doc/rdoc/classes/ESI/Fragment.src/{M000101.html → M000112.html} +0 -0
- data/doc/rdoc/classes/ESI/Fragment.src/{M000102.html → M000113.html} +0 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.html +46 -46
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000037.html +24 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000038.html +22 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000039.html +19 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000040.html +10 -11
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000041.html +5 -9
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000042.html +6 -6
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000043.html +5 -10
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000044.html +5 -5
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000045.html +4 -6
- data/doc/rdoc/classes/ESI/OutputAdapter.html +204 -0
- data/doc/rdoc/classes/ESI/OutputAdapter.src/M000094.html +37 -0
- data/doc/rdoc/classes/ESI/OutputAdapter.src/M000095.html +18 -0
- data/doc/rdoc/classes/ESI/OutputAdapter.src/M000096.html +18 -0
- data/doc/rdoc/classes/ESI/OutputAdapter.src/M000097.html +18 -0
- data/doc/rdoc/classes/ESI/Parser.html +15 -15
- data/doc/rdoc/classes/ESI/Parser.src/{M000049.html → M000065.html} +0 -0
- data/doc/rdoc/classes/ESI/Parser.src/{M000050.html → M000066.html} +0 -0
- data/doc/rdoc/classes/ESI/Parser.src/{M000051.html → M000067.html} +0 -0
- data/doc/rdoc/classes/ESI/Processor.html +15 -15
- data/doc/rdoc/classes/ESI/Processor.src/{M000037.html → M000046.html} +0 -0
- data/doc/rdoc/classes/ESI/Processor.src/{M000038.html → M000047.html} +1 -1
- data/doc/rdoc/classes/ESI/Processor.src/{M000039.html → M000048.html} +0 -0
- data/doc/rdoc/classes/ESI/Proxy.html +48 -48
- data/doc/rdoc/classes/ESI/Proxy.src/M000071.html +7 -40
- data/doc/rdoc/classes/ESI/Proxy.src/M000072.html +50 -12
- data/doc/rdoc/classes/ESI/Proxy.src/M000073.html +49 -6
- data/doc/rdoc/classes/ESI/Proxy.src/M000074.html +11 -14
- data/doc/rdoc/classes/ESI/Proxy.src/M000075.html +6 -5
- data/doc/rdoc/classes/ESI/Proxy.src/M000076.html +9 -15
- data/doc/rdoc/classes/ESI/Proxy.src/M000077.html +5 -16
- data/doc/rdoc/classes/ESI/Proxy.src/M000078.html +28 -0
- data/doc/rdoc/classes/ESI/Proxy.src/M000079.html +29 -0
- data/doc/rdoc/classes/ESI/RackAdapter.html +214 -0
- data/doc/rdoc/classes/ESI/RackAdapter.src/M000068.html +18 -0
- data/doc/rdoc/classes/ESI/RackAdapter.src/M000069.html +34 -0
- data/doc/rdoc/classes/ESI/{MemcachedCache.src/M000048.html → RackAdapter.src/M000070.html} +4 -4
- data/doc/rdoc/classes/ESI/RackConfig.html +173 -0
- data/doc/rdoc/classes/ESI/RackConfig.src/M000089.html +28 -0
- data/doc/rdoc/classes/ESI/RackConfig.src/M000090.html +18 -0
- data/doc/rdoc/classes/ESI/RackConfig.src/M000091.html +20 -0
- data/doc/rdoc/classes/ESI/Request.html +158 -0
- data/doc/rdoc/classes/ESI/{MemcachedCache.src/M000046.html → Request.src/M000098.html} +5 -5
- data/doc/rdoc/classes/ESI/Request.src/M000099.html +18 -0
- data/doc/rdoc/classes/ESI/Response.html +36 -36
- data/doc/rdoc/classes/ESI/Response.src/M000080.html +10 -8
- data/doc/rdoc/classes/ESI/Response.src/M000081.html +5 -7
- data/doc/rdoc/classes/ESI/Response.src/M000082.html +8 -12
- data/doc/rdoc/classes/ESI/Response.src/M000083.html +7 -5
- data/doc/rdoc/classes/ESI/Response.src/M000084.html +12 -20
- data/doc/rdoc/classes/ESI/Response.src/{M000079.html → M000085.html} +5 -5
- data/doc/rdoc/classes/ESI/Response.src/M000086.html +33 -0
- data/doc/rdoc/classes/ESI/Router.html +10 -10
- data/doc/rdoc/classes/ESI/Router.src/{M000098.html → M000109.html} +0 -0
- data/doc/rdoc/classes/ESI/Router.src/{M000099.html → M000110.html} +0 -0
- data/doc/rdoc/classes/ESI/RubyCache.html +45 -45
- data/doc/rdoc/classes/ESI/RubyCache.src/{M000089.html → M000100.html} +6 -6
- data/doc/rdoc/classes/ESI/RubyCache.src/{M000090.html → M000101.html} +6 -6
- data/doc/rdoc/classes/ESI/RubyCache.src/{M000091.html → M000102.html} +6 -6
- data/doc/rdoc/classes/ESI/RubyCache.src/{M000092.html → M000103.html} +8 -8
- data/doc/rdoc/classes/ESI/RubyCache.src/{M000093.html → M000104.html} +4 -4
- data/doc/rdoc/classes/ESI/RubyCache.src/{M000094.html → M000105.html} +8 -8
- data/doc/rdoc/classes/ESI/RubyCache.src/{M000095.html → M000106.html} +4 -4
- data/doc/rdoc/classes/ESI/RubyCache.src/{M000096.html → M000107.html} +4 -4
- data/doc/rdoc/classes/ESI/RubyCache.src/{M000097.html → M000108.html} +4 -4
- data/doc/rdoc/classes/ESI/Tag.html +8 -8
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/COPYING.html +1 -1
- data/doc/rdoc/files/LICENSE.html +1 -1
- data/doc/rdoc/files/README.html +12 -10
- data/doc/rdoc/files/ext/esi/common_rl.html +1 -1
- data/doc/rdoc/files/ext/esi/esi_parser_c.html +1 -1
- data/doc/rdoc/files/ext/esi/parser_c.html +1 -1
- data/doc/rdoc/files/ext/esi/parser_h.html +1 -1
- data/doc/rdoc/files/ext/esi/parser_rl.html +122 -82
- data/doc/rdoc/files/ext/esi/test/test_c.html +1 -1
- data/doc/rdoc/files/lib/esi/cache_rb.html +2 -1
- data/doc/rdoc/files/lib/esi/config_rb.html +2 -1
- data/doc/rdoc/files/lib/esi/dispatcher_rb.html +3 -1
- data/doc/rdoc/files/lib/esi/invalidator_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/logger_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/parser_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/processor_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/proxy_rb.html +2 -2
- data/doc/rdoc/files/{ext/esi/test/parser_c.html → lib/esi/rack_adapter_rb.html} +21 -5
- data/doc/rdoc/files/lib/esi/response_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/router_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/tag/attempt_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/tag/base_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/tag/container_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/tag/except_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/tag/include_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/tag/invalidate_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/tag/try_rb.html +1 -1
- data/doc/rdoc/files/lib/esi/version_rb.html +1 -1
- data/doc/rdoc/files/lib/multi_dirhandler_rb.html +1 -1
- data/doc/rdoc/fr_class_index.html +4 -0
- data/doc/rdoc/fr_file_index.html +1 -5
- data/doc/rdoc/fr_method_index.html +87 -76
- data/ext/esi/esi_parser.c +2 -2
- data/ext/esi/parser.c +133 -107
- data/ext/esi/parser.h +9 -4
- data/ext/esi/parser.rl +99 -73
- data/ext/esi/test/test.c +11 -6
- data/lib/esi/cache.rb +7 -3
- data/lib/esi/config.rb +4 -8
- data/lib/esi/dispatcher.rb +14 -5
- data/lib/esi/processor.rb +1 -1
- data/lib/esi/proxy.rb +58 -48
- data/lib/esi/rack_adapter.rb +97 -0
- data/lib/esi/response.rb +30 -1
- data/lib/esi/version.rb +1 -1
- data/test/bench-plot.rb +31 -0
- data/test/benchmarks/csv-perf-serial0.4 +101 -0
- data/test/benchmarks/csv-perf-trunk +101 -0
- data/test/benchmarks/perf-serial0.4-n1000-c1.csv +101 -0
- data/test/benchmarks/perf-serial0.4-n1000-c2.csv +101 -0
- data/test/benchmarks/perf-serial0.4-n1000-c3.csv +101 -0
- data/test/benchmarks/perf-serial0.4-n1000-c4.csv +101 -0
- data/test/benchmarks/perf-serial0.4-n1000-c5.csv +101 -0
- data/test/benchmarks/perf-serial0.4-n1000-c6.csv +101 -0
- data/test/benchmarks/perf-serial0.4-n1000-c7.csv +101 -0
- data/test/benchmarks/perf-trunk-n1000-c1.csv +101 -0
- data/test/benchmarks/perf-trunk-n1000-c2.csv +101 -0
- data/test/benchmarks/perf-trunk-n1000-c3.csv +101 -0
- data/test/benchmarks/perf-trunk-n1000-c4.csv +101 -0
- data/test/benchmarks/perf-trunk-n1000-c5.csv +101 -0
- data/test/benchmarks/perf-trunk-n1000-c6.csv +101 -0
- data/test/benchmarks/perf-trunk-n1000-c7.csv +101 -0
- data/test/load_test.rb +5 -2
- data/test/load_test_ab.rb +9 -4
- metadata +261 -227
- data/doc/rdoc/classes/ESI/Config.src/M000057.html +0 -18
- data/doc/rdoc/classes/ESI/Config.src/M000058.html +0 -20
- data/doc/rdoc/classes/ESI/Config.src/M000060.html +0 -24
- data/doc/rdoc/classes/ESI/Dispatcher.src/M000088.html +0 -18
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000047.html +0 -18
- data/doc/rdoc/classes/ESI/Proxy.src/M000069.html +0 -20
- data/doc/rdoc/classes/ESI/Proxy.src/M000070.html +0 -55
- data/doc/rdoc/classes/ESI/Response.src/M000078.html +0 -23
- data/doc/rdoc/files/ext/esi/test/common_rl.html +0 -160
- data/doc/rdoc/files/ext/esi/test/parser_h.html +0 -101
- data/doc/rdoc/files/ext/esi/test/parser_rl.html +0 -827
- data/doc/rdoc/files/ext/esi/test/sp_c.html +0 -101
- data/ext/esi/test/common.rl +0 -46
- data/ext/esi/test/parser.c +0 -1875
- data/ext/esi/test/parser.h +0 -120
- data/ext/esi/test/parser.rl +0 -585
- data/ext/esi/test/sp.c +0 -125
data/README
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=About
|
2
|
-
|
2
|
+
mongrel-esi is meant to make caching easier by distributing the cache logic.
|
3
3
|
|
4
4
|
The idea is to represent each part of the page as a unique URL.
|
5
5
|
|
@@ -9,11 +9,12 @@ specific <esi:* tags before servering the response. MongrelESI currently, only
|
|
9
9
|
=Tags
|
10
10
|
|
11
11
|
esi:include:
|
12
|
-
src
|
12
|
+
src - request path, response replaces esi:include tag
|
13
|
+
alt - if src is unavailable, use alt
|
13
14
|
timeout - how long to wait on the response
|
14
15
|
max-age - how long to cache the entity
|
15
16
|
onerror - whether continue on errors or trigger an exception
|
16
|
-
|
17
|
+
|
17
18
|
esi:invalidate:
|
18
19
|
encloses invalidation instructions.
|
19
20
|
these instructions currently only support basic invalidation
|
@@ -39,7 +40,7 @@ esi:try/esi:attempt/esi:except
|
|
39
40
|
|
40
41
|
=Proxy Config
|
41
42
|
|
42
|
-
|
43
|
+
mongrel-esi is a proxy server. To configure where requests should be proxied modify the config/routes.yml file.
|
43
44
|
|
44
45
|
Here's an example:
|
45
46
|
|
@@ -87,7 +88,7 @@ If the uri is not already cached, the cache server will request /content/1, whic
|
|
87
88
|
|
88
89
|
<div>hello User42</div>
|
89
90
|
|
90
|
-
And finally,
|
91
|
+
And finally, mongrel-esi will respond to the original client request with the combined documents:
|
91
92
|
<html>
|
92
93
|
<head><title>Your Page</title>
|
93
94
|
</head>
|
@@ -101,7 +102,7 @@ And finally, MongrelESI will respond to the original client request with the com
|
|
101
102
|
|
102
103
|
== Integrating with your applications
|
103
104
|
|
104
|
-
|
105
|
+
mongrel-esi was built to support integrating lots of applications together.
|
105
106
|
|
106
107
|
Primarily, you'll want to integrate by having one base application and many tiny applications that
|
107
108
|
surface within your primary application. In the rails sense think components. In a bigger sense think
|
@@ -109,11 +110,11 @@ multiple application technologies all integrating into the same application. Im
|
|
109
110
|
returning up to the minute chat conversations in one part of the page, while rails delivers a reliable listing of
|
110
111
|
current forum discussion, and maybe a python presense indicator for forum posts...
|
111
112
|
|
112
|
-
One thing to keep in mind is mongrel
|
113
|
+
One thing to keep in mind is mongrel-esi is a proxy server. This means for each request it needs to know where to route
|
113
114
|
the requests. To support this config.rb can express any regex to match a url and determine where a request should be
|
114
115
|
forwarded as well as defining a default route.
|
115
116
|
|
116
|
-
It is also sometimes convenient to allow multiple applications to store or house static content. For this to work mongrel
|
117
|
+
It is also sometimes convenient to allow multiple applications to store or house static content. For this to work mongrel-esi
|
117
118
|
needs to know in what directories to search for static files. This can be done by using the MultiDirHandler (see rev-config.rb)
|
118
119
|
|
119
120
|
|
@@ -121,7 +122,7 @@ needs to know in what directories to search for static files. This can be done
|
|
121
122
|
|
122
123
|
From [http://www.w3.org/TR/esi-lang esi-lang]
|
123
124
|
|
124
|
-
|
125
|
+
mongrel-esi supports basic include, exception handling and invalidation. It does not include support for
|
125
126
|
Variable or Conditional processing. It does have suppport for COOKIE variables.
|
126
127
|
(e.g. $(HTTP_COOKIE{name}) will be replaced with the value of the cookie, name)
|
127
128
|
|
@@ -110,8 +110,8 @@ Base <a href="Cache.html">Cache</a> object
|
|
110
110
|
<h3 class="section-bar">Methods</h3>
|
111
111
|
|
112
112
|
<div class="name-list">
|
113
|
-
<a href="#
|
114
|
-
<a href="#
|
113
|
+
<a href="#M000088">cache_key</a>
|
114
|
+
<a href="#M000087">new</a>
|
115
115
|
</div>
|
116
116
|
</div>
|
117
117
|
|
@@ -133,12 +133,12 @@ Base <a href="Cache.html">Cache</a> object
|
|
133
133
|
<div id="methods">
|
134
134
|
<h3 class="section-bar">Public Class methods</h3>
|
135
135
|
|
136
|
-
<div id="method-
|
137
|
-
<a name="
|
136
|
+
<div id="method-M000087" class="method-detail">
|
137
|
+
<a name="M000087"></a>
|
138
138
|
|
139
139
|
<div class="method-heading">
|
140
|
-
<a href="Cache.src/
|
141
|
-
onclick="popupCode('Cache.src/
|
140
|
+
<a href="Cache.src/M000087.html" target="Code" class="method-signature"
|
141
|
+
onclick="popupCode('Cache.src/M000087.html');return false;">
|
142
142
|
<span class="method-name">new</span><span class="method-args">()</span>
|
143
143
|
</a>
|
144
144
|
</div>
|
@@ -149,12 +149,12 @@ Base <a href="Cache.html">Cache</a> object
|
|
149
149
|
|
150
150
|
<h3 class="section-bar">Protected Instance methods</h3>
|
151
151
|
|
152
|
-
<div id="method-
|
153
|
-
<a name="
|
152
|
+
<div id="method-M000088" class="method-detail">
|
153
|
+
<a name="M000088"></a>
|
154
154
|
|
155
155
|
<div class="method-heading">
|
156
|
-
<a href="Cache.src/
|
157
|
-
onclick="popupCode('Cache.src/
|
156
|
+
<a href="Cache.src/M000088.html" target="Code" class="method-signature"
|
157
|
+
onclick="popupCode('Cache.src/M000088.html');return false;">
|
158
158
|
<span class="method-name">cache_key</span><span class="method-args">( uri, params )</span>
|
159
159
|
</a>
|
160
160
|
</div>
|
File without changes
|
File without changes
|
@@ -81,7 +81,7 @@
|
|
81
81
|
<div id="description">
|
82
82
|
<p>
|
83
83
|
This file provides configuration options to mongrel-<a
|
84
|
-
href="Config.html#
|
84
|
+
href="Config.html#M000053">esi</a> Mongrel ESI is a proxy caching server
|
85
85
|
with limited load balancing capablities
|
86
86
|
</p>
|
87
87
|
<pre>
|
@@ -128,15 +128,14 @@ with limited load balancing capablities
|
|
128
128
|
<h3 class="section-bar">Methods</h3>
|
129
129
|
|
130
130
|
<div class="name-list">
|
131
|
-
<a href="#
|
132
|
-
<a href="#
|
133
|
-
<a href="#
|
134
|
-
<a href="#
|
135
|
-
<a href="#
|
136
|
-
<a href="#
|
137
|
-
<a href="#
|
138
|
-
<a href="#
|
139
|
-
<a href="#M000059">start_invalidator?</a>
|
131
|
+
<a href="#M000050">[]</a>
|
132
|
+
<a href="#M000052">cache</a>
|
133
|
+
<a href="#M000056">define</a>
|
134
|
+
<a href="#M000051">enable_esi_processor?</a>
|
135
|
+
<a href="#M000053">esi</a>
|
136
|
+
<a href="#M000049">new</a>
|
137
|
+
<a href="#M000054">router</a>
|
138
|
+
<a href="#M000055">routes</a>
|
140
139
|
</div>
|
141
140
|
</div>
|
142
141
|
|
@@ -178,12 +177,12 @@ Class <a href="Config/ConfigRouter.html" class="link">ESI::Config::ConfigRouter<
|
|
178
177
|
<div id="methods">
|
179
178
|
<h3 class="section-bar">Public Class methods</h3>
|
180
179
|
|
181
|
-
<div id="method-
|
182
|
-
<a name="
|
180
|
+
<div id="method-M000056" class="method-detail">
|
181
|
+
<a name="M000056"></a>
|
183
182
|
|
184
183
|
<div class="method-heading">
|
185
|
-
<a href="Config.src/
|
186
|
-
onclick="popupCode('Config.src/
|
184
|
+
<a href="Config.src/M000056.html" target="Code" class="method-signature"
|
185
|
+
onclick="popupCode('Config.src/M000056.html');return false;">
|
187
186
|
<span class="method-name">define</span><span class="method-args">( listeners ) {|config| ...}</span>
|
188
187
|
</a>
|
189
188
|
</div>
|
@@ -192,12 +191,12 @@ Class <a href="Config/ConfigRouter.html" class="link">ESI::Config::ConfigRouter<
|
|
192
191
|
</div>
|
193
192
|
</div>
|
194
193
|
|
195
|
-
<div id="method-
|
196
|
-
<a name="
|
194
|
+
<div id="method-M000049" class="method-detail">
|
195
|
+
<a name="M000049"></a>
|
197
196
|
|
198
197
|
<div class="method-heading">
|
199
|
-
<a href="Config.src/
|
200
|
-
onclick="popupCode('Config.src/
|
198
|
+
<a href="Config.src/M000049.html" target="Code" class="method-signature"
|
199
|
+
onclick="popupCode('Config.src/M000049.html');return false;">
|
201
200
|
<span class="method-name">new</span><span class="method-args">(options)</span>
|
202
201
|
</a>
|
203
202
|
</div>
|
@@ -208,12 +207,12 @@ Class <a href="Config/ConfigRouter.html" class="link">ESI::Config::ConfigRouter<
|
|
208
207
|
|
209
208
|
<h3 class="section-bar">Public Instance methods</h3>
|
210
209
|
|
211
|
-
<div id="method-
|
212
|
-
<a name="
|
210
|
+
<div id="method-M000050" class="method-detail">
|
211
|
+
<a name="M000050"></a>
|
213
212
|
|
214
213
|
<div class="method-heading">
|
215
|
-
<a href="Config.src/
|
216
|
-
onclick="popupCode('Config.src/
|
214
|
+
<a href="Config.src/M000050.html" target="Code" class="method-signature"
|
215
|
+
onclick="popupCode('Config.src/M000050.html');return false;">
|
217
216
|
<span class="method-name">[]</span><span class="method-args">(key)</span>
|
218
217
|
</a>
|
219
218
|
</div>
|
@@ -225,31 +224,31 @@ access configuration values
|
|
225
224
|
</div>
|
226
225
|
</div>
|
227
226
|
|
228
|
-
<div id="method-
|
229
|
-
<a name="
|
227
|
+
<div id="method-M000052" class="method-detail">
|
228
|
+
<a name="M000052"></a>
|
230
229
|
|
231
230
|
<div class="method-heading">
|
232
|
-
<a href="Config.src/
|
233
|
-
onclick="popupCode('Config.src/
|
231
|
+
<a href="Config.src/M000052.html" target="Code" class="method-signature"
|
232
|
+
onclick="popupCode('Config.src/M000052.html');return false;">
|
234
233
|
<span class="method-name">cache</span><span class="method-args">() {|cache_options| ...}</span>
|
235
234
|
</a>
|
236
235
|
</div>
|
237
236
|
|
238
237
|
<div class="method-description">
|
239
238
|
<p>
|
240
|
-
returns the <a href="Config.html#
|
241
|
-
config/esi.yml <a href="Config.html#
|
239
|
+
returns the <a href="Config.html#M000052">cache</a> object as given in the
|
240
|
+
config/esi.yml <a href="Config.html#M000052">cache</a>: key, or defaults to
|
242
241
|
ruby as in uses this process the options allowed are ruby and memcache
|
243
242
|
</p>
|
244
243
|
</div>
|
245
244
|
</div>
|
246
245
|
|
247
|
-
<div id="method-
|
248
|
-
<a name="
|
246
|
+
<div id="method-M000051" class="method-detail">
|
247
|
+
<a name="M000051"></a>
|
249
248
|
|
250
249
|
<div class="method-heading">
|
251
|
-
<a href="Config.src/
|
252
|
-
onclick="popupCode('Config.src/
|
250
|
+
<a href="Config.src/M000051.html" target="Code" class="method-signature"
|
251
|
+
onclick="popupCode('Config.src/M000051.html');return false;">
|
253
252
|
<span class="method-name">enable_esi_processor?</span><span class="method-args">( headers )</span>
|
254
253
|
</a>
|
255
254
|
</div>
|
@@ -258,12 +257,12 @@ ruby as in uses this process the options allowed are ruby and memcache
|
|
258
257
|
</div>
|
259
258
|
</div>
|
260
259
|
|
261
|
-
<div id="method-
|
262
|
-
<a name="
|
260
|
+
<div id="method-M000053" class="method-detail">
|
261
|
+
<a name="M000053"></a>
|
263
262
|
|
264
263
|
<div class="method-heading">
|
265
|
-
<a href="Config.src/
|
266
|
-
onclick="popupCode('Config.src/
|
264
|
+
<a href="Config.src/M000053.html" target="Code" class="method-signature"
|
265
|
+
onclick="popupCode('Config.src/M000053.html');return false;">
|
267
266
|
<span class="method-name">esi</span><span class="method-args">() {|options| ...}</span>
|
268
267
|
</a>
|
269
268
|
</div>
|
@@ -272,12 +271,12 @@ ruby as in uses this process the options allowed are ruby and memcache
|
|
272
271
|
</div>
|
273
272
|
</div>
|
274
273
|
|
275
|
-
<div id="method-
|
276
|
-
<a name="
|
274
|
+
<div id="method-M000054" class="method-detail">
|
275
|
+
<a name="M000054"></a>
|
277
276
|
|
278
277
|
<div class="method-heading">
|
279
|
-
<a href="Config.src/
|
280
|
-
onclick="popupCode('Config.src/
|
278
|
+
<a href="Config.src/M000054.html" target="Code" class="method-signature"
|
279
|
+
onclick="popupCode('Config.src/M000054.html');return false;">
|
281
280
|
<span class="method-name">router</span><span class="method-args">()</span>
|
282
281
|
</a>
|
283
282
|
</div>
|
@@ -286,12 +285,12 @@ ruby as in uses this process the options allowed are ruby and memcache
|
|
286
285
|
</div>
|
287
286
|
</div>
|
288
287
|
|
289
|
-
<div id="method-
|
290
|
-
<a name="
|
288
|
+
<div id="method-M000055" class="method-detail">
|
289
|
+
<a name="M000055"></a>
|
291
290
|
|
292
291
|
<div class="method-heading">
|
293
|
-
<a href="Config.src/
|
294
|
-
onclick="popupCode('Config.src/
|
292
|
+
<a href="Config.src/M000055.html" target="Code" class="method-signature"
|
293
|
+
onclick="popupCode('Config.src/M000055.html');return false;">
|
295
294
|
<span class="method-name">routes</span><span class="method-args">() {|config_router| ...}</span>
|
296
295
|
</a>
|
297
296
|
</div>
|
@@ -300,24 +299,6 @@ ruby as in uses this process the options allowed are ruby and memcache
|
|
300
299
|
</div>
|
301
300
|
</div>
|
302
301
|
|
303
|
-
<div id="method-M000059" class="method-detail">
|
304
|
-
<a name="M000059"></a>
|
305
|
-
|
306
|
-
<div class="method-heading">
|
307
|
-
<a href="Config.src/M000059.html" target="Code" class="method-signature"
|
308
|
-
onclick="popupCode('Config.src/M000059.html');return false;">
|
309
|
-
<span class="method-name">start_invalidator?</span><span class="method-args">()</span>
|
310
|
-
</a>
|
311
|
-
</div>
|
312
|
-
|
313
|
-
<div class="method-description">
|
314
|
-
<p>
|
315
|
-
return true/false depending on the value of invalidator: on/off within in
|
316
|
-
config/esi.yml
|
317
|
-
</p>
|
318
|
-
</div>
|
319
|
-
</div>
|
320
|
-
|
321
302
|
|
322
303
|
</div>
|
323
304
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>new (ESI::Config)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/config.rb, line 46</span>
|
14
|
+
46: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>)
|
15
|
+
47: <span class="ruby-ivar">@config</span> = <span class="ruby-identifier">options</span>
|
16
|
+
48: <span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>[] (ESI::Config)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre>
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/config.rb, line 51</span>
|
14
|
+
51: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
|
15
|
+
52: <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">key</span>]
|
16
|
+
53: <span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>enable_esi_processor? (ESI::Config)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/config.rb, line 55</span>
|
14
|
+
55: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">enable_esi_processor?</span>( <span class="ruby-identifier">headers</span> )
|
15
|
+
56: <span class="ruby-comment cmt"># check for surrogate control configuration</span>
|
16
|
+
57: <span class="ruby-comment cmt"># check for matching content type</span>
|
17
|
+
58: <span class="ruby-comment cmt"># if both are set it surrogate takes presendence </span>
|
18
|
+
59: <span class="ruby-identifier">use_esi</span> = <span class="ruby-keyword kw">false</span>
|
19
|
+
60: <span class="ruby-identifier">allowed_content_types</span> = <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">:allowed_content_types</span>]
|
20
|
+
61:
|
21
|
+
62: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">allowed_content_types</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">headers</span>[<span class="ruby-value str">"content-type"</span>] <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">allowed_content_types</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:detect</span>)
|
22
|
+
63: <span class="ruby-identifier">use_esi</span> = <span class="ruby-identifier">allowed_content_types</span>.<span class="ruby-identifier">detect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span>
|
23
|
+
64: <span class="ruby-identifier">headers</span>[<span class="ruby-value str">"content-type"</span>].<span class="ruby-identifier">match</span>( <span class="ruby-identifier">type</span> )
|
24
|
+
65: <span class="ruby-keyword kw">end</span>
|
25
|
+
66: <span class="ruby-identifier">use_esi</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">use_esi</span>
|
26
|
+
67: <span class="ruby-keyword kw">end</span>
|
27
|
+
68:
|
28
|
+
69: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">:enable_for_surrogate_only</span>]
|
29
|
+
70: <span class="ruby-identifier">use_esi</span> = <span class="ruby-identifier">headers</span>[<span class="ruby-value str">"surrogate-control"</span>] <span class="ruby-keyword kw">and</span> <span class="ruby-regexp re">/ESI/</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">headers</span>[<span class="ruby-value str">"surrogate-control"</span>])
|
30
|
+
71: <span class="ruby-keyword kw">end</span>
|
31
|
+
72:
|
32
|
+
73: <span class="ruby-identifier">use_esi</span>
|
33
|
+
74: <span class="ruby-keyword kw">end</span></pre>
|
34
|
+
</body>
|
35
|
+
</html>
|
@@ -5,14 +5,36 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>cache (ESI::Config)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre>
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/config.rb, line 105</span>
|
14
|
+
105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache</span>
|
15
|
+
106: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
16
|
+
107: <span class="ruby-comment cmt"># allow this method to be called in config scripts</span>
|
17
|
+
108: <span class="ruby-identifier">cache_options</span> = <span class="ruby-constant">CacheConfig</span>.<span class="ruby-identifier">new</span>
|
18
|
+
109: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">cache_options</span>
|
19
|
+
110: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cache_options</span>.<span class="ruby-identifier">memcached?</span>
|
20
|
+
111: <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">:cache</span>] = <span class="ruby-value str">'memcached'</span>
|
21
|
+
112: <span class="ruby-keyword kw">else</span>
|
22
|
+
113: <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">:cache</span>] = <span class="ruby-value str">'ruby'</span>
|
23
|
+
114: <span class="ruby-keyword kw">end</span>
|
24
|
+
115: <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">:cache_options</span>] = <span class="ruby-identifier">cache_options</span>.<span class="ruby-identifier">options</span>
|
25
|
+
116: <span class="ruby-keyword kw">else</span>
|
26
|
+
117: <span class="ruby-identifier">cache_type</span> = <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">:cache</span>]
|
27
|
+
118: <span class="ruby-identifier">options</span> = <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">:cache_options</span>]
|
28
|
+
119: <span class="ruby-comment cmt"># always return the same cache object, per process</span>
|
29
|
+
120: <span class="ruby-identifier">$cache</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">cache_type</span>
|
30
|
+
121: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'ruby'</span>
|
31
|
+
122: <span class="ruby-constant">ESI</span><span class="ruby-operator">::</span><span class="ruby-constant">RubyCache</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>)
|
32
|
+
123: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'memcached'</span>
|
33
|
+
124: <span class="ruby-constant">ESI</span><span class="ruby-operator">::</span><span class="ruby-constant">MemcachedCache</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>)
|
34
|
+
125: <span class="ruby-keyword kw">else</span>
|
35
|
+
126: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Unsupported cache"</span>
|
36
|
+
127: <span class="ruby-keyword kw">end</span>
|
37
|
+
128: <span class="ruby-keyword kw">end</span>
|
38
|
+
129: <span class="ruby-keyword kw">end</span></pre>
|
17
39
|
</body>
|
18
40
|
</html>
|
@@ -5,14 +5,19 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>esi (ESI::Config)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre>
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/config.rb, line 131</span>
|
14
|
+
131: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">esi</span>
|
15
|
+
132: <span class="ruby-identifier">options</span> = <span class="ruby-constant">OpenStruct</span>.<span class="ruby-identifier">new</span>({})
|
16
|
+
133: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">options</span>
|
17
|
+
134: <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">:allowed_content_types</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">allowed_content_types</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">allowed_content_types</span>
|
18
|
+
135: <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">:enable_for_surrogate_only</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">enable_for_surrogate_only</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">enable_for_surrogate_only</span>
|
19
|
+
136: <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">:chunk_size</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">chunk_size</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">chunk_size</span>
|
20
|
+
137: <span class="ruby-ivar">@config</span>[<span class="ruby-identifier">:max_depth</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">max_depth</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">max_depth</span>
|
21
|
+
138: <span class="ruby-keyword kw">end</span></pre>
|
17
22
|
</body>
|
18
23
|
</html>
|