mongrel_esi 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ext/esi/esi_parser.c +1 -0
- data/ext/esi/extconf.rb +2 -0
- data/ext/esi/parser.c +2 -2
- data/ext/esi/parser.h +2 -0
- data/ext/esi/parser.rl +2 -2
- data/ext/esi/test/common.rl +46 -0
- data/ext/esi/test/parser.c +1901 -0
- data/ext/esi/test/parser.h +127 -0
- data/ext/esi/test/parser.rl +611 -0
- data/ext/esi/test/test.c +2 -2
- data/lib/esi/cache.rb +1 -1
- data/lib/esi/version.rb +1 -1
- data/test/benchmarks/perf-trunk-n1000-c1.csv +100 -100
- data/test/benchmarks/perf-trunk-n1000-c2.csv +100 -100
- data/test/benchmarks/perf-trunk-n1000-c3.csv +100 -100
- data/test/benchmarks/perf-trunk-n1000-c4.csv +100 -100
- data/test/benchmarks/perf-trunk-n1000-c5.csv +100 -100
- data/test/integration/docs/large-no-cache.html +688 -0
- data/test/integration/handler_test.rb +7 -2
- data/test/load_test_ab.rb +1 -1
- metadata +7 -222
- data/doc/rdoc/classes/ESI/CParser.html +0 -122
- data/doc/rdoc/classes/ESI/Cache.html +0 -178
- data/doc/rdoc/classes/ESI/Cache.src/M000087.html +0 -17
- data/doc/rdoc/classes/ESI/Cache.src/M000088.html +0 -20
- data/doc/rdoc/classes/ESI/Config.html +0 -314
- data/doc/rdoc/classes/ESI/Config.src/M000049.html +0 -18
- data/doc/rdoc/classes/ESI/Config.src/M000050.html +0 -18
- data/doc/rdoc/classes/ESI/Config.src/M000051.html +0 -35
- data/doc/rdoc/classes/ESI/Config.src/M000052.html +0 -40
- data/doc/rdoc/classes/ESI/Config.src/M000053.html +0 -23
- data/doc/rdoc/classes/ESI/Config.src/M000054.html +0 -18
- data/doc/rdoc/classes/ESI/Config.src/M000055.html +0 -20
- data/doc/rdoc/classes/ESI/Config.src/M000056.html +0 -24
- data/doc/rdoc/classes/ESI/Config/CacheConfig.html +0 -212
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000060.html +0 -19
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000061.html +0 -19
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000062.html +0 -18
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000063.html +0 -18
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000064.html +0 -18
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.html +0 -187
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000057.html +0 -19
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000058.html +0 -21
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000059.html +0 -21
- data/doc/rdoc/classes/ESI/Dispatcher.html +0 -174
- data/doc/rdoc/classes/ESI/Dispatcher.src/M000092.html +0 -19
- data/doc/rdoc/classes/ESI/Dispatcher.src/M000093.html +0 -27
- data/doc/rdoc/classes/ESI/Fragment.html +0 -218
- data/doc/rdoc/classes/ESI/Fragment.src/M000111.html +0 -20
- data/doc/rdoc/classes/ESI/Fragment.src/M000112.html +0 -18
- data/doc/rdoc/classes/ESI/Fragment.src/M000113.html +0 -18
- data/doc/rdoc/classes/ESI/Invalidator.html +0 -131
- data/doc/rdoc/classes/ESI/Invalidator.src/M000004.html +0 -41
- data/doc/rdoc/classes/ESI/Log.html +0 -221
- data/doc/rdoc/classes/ESI/Log.src/M000030.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000031.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000032.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000033.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000034.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000035.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000036.html +0 -18
- data/doc/rdoc/classes/ESI/MemcachedCache.html +0 -314
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000037.html +0 -24
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000038.html +0 -22
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000039.html +0 -19
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000040.html +0 -23
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000041.html +0 -18
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000042.html +0 -19
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000043.html +0 -18
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000044.html +0 -18
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000045.html +0 -17
- data/doc/rdoc/classes/ESI/OutputAdapter.html +0 -204
- data/doc/rdoc/classes/ESI/OutputAdapter.src/M000094.html +0 -37
- data/doc/rdoc/classes/ESI/OutputAdapter.src/M000095.html +0 -18
- data/doc/rdoc/classes/ESI/OutputAdapter.src/M000096.html +0 -18
- data/doc/rdoc/classes/ESI/OutputAdapter.src/M000097.html +0 -18
- data/doc/rdoc/classes/ESI/Parser.html +0 -184
- data/doc/rdoc/classes/ESI/Parser.src/M000065.html +0 -51
- data/doc/rdoc/classes/ESI/Parser.src/M000066.html +0 -39
- data/doc/rdoc/classes/ESI/Parser.src/M000067.html +0 -19
- data/doc/rdoc/classes/ESI/Processor.html +0 -194
- data/doc/rdoc/classes/ESI/Processor.src/M000046.html +0 -26
- data/doc/rdoc/classes/ESI/Processor.src/M000047.html +0 -44
- data/doc/rdoc/classes/ESI/Processor.src/M000048.html +0 -26
- data/doc/rdoc/classes/ESI/Proxy.html +0 -304
- data/doc/rdoc/classes/ESI/Proxy.src/M000071.html +0 -20
- data/doc/rdoc/classes/ESI/Proxy.src/M000072.html +0 -63
- data/doc/rdoc/classes/ESI/Proxy.src/M000073.html +0 -62
- data/doc/rdoc/classes/ESI/Proxy.src/M000074.html +0 -24
- data/doc/rdoc/classes/ESI/Proxy.src/M000075.html +0 -19
- data/doc/rdoc/classes/ESI/Proxy.src/M000076.html +0 -22
- data/doc/rdoc/classes/ESI/Proxy.src/M000077.html +0 -18
- data/doc/rdoc/classes/ESI/Proxy.src/M000078.html +0 -28
- data/doc/rdoc/classes/ESI/Proxy.src/M000079.html +0 -29
- data/doc/rdoc/classes/ESI/RackAdapter.html +0 -214
- data/doc/rdoc/classes/ESI/RackAdapter.src/M000068.html +0 -18
- data/doc/rdoc/classes/ESI/RackAdapter.src/M000069.html +0 -34
- data/doc/rdoc/classes/ESI/RackAdapter.src/M000070.html +0 -17
- data/doc/rdoc/classes/ESI/RackConfig.html +0 -173
- data/doc/rdoc/classes/ESI/RackConfig.src/M000089.html +0 -28
- data/doc/rdoc/classes/ESI/RackConfig.src/M000090.html +0 -18
- data/doc/rdoc/classes/ESI/RackConfig.src/M000091.html +0 -20
- data/doc/rdoc/classes/ESI/Request.html +0 -158
- data/doc/rdoc/classes/ESI/Request.src/M000098.html +0 -18
- data/doc/rdoc/classes/ESI/Request.src/M000099.html +0 -18
- data/doc/rdoc/classes/ESI/Response.html +0 -250
- data/doc/rdoc/classes/ESI/Response.src/M000080.html +0 -23
- data/doc/rdoc/classes/ESI/Response.src/M000081.html +0 -18
- data/doc/rdoc/classes/ESI/Response.src/M000082.html +0 -21
- data/doc/rdoc/classes/ESI/Response.src/M000083.html +0 -20
- data/doc/rdoc/classes/ESI/Response.src/M000084.html +0 -25
- data/doc/rdoc/classes/ESI/Response.src/M000085.html +0 -18
- data/doc/rdoc/classes/ESI/Response.src/M000086.html +0 -33
- data/doc/rdoc/classes/ESI/Router.html +0 -212
- data/doc/rdoc/classes/ESI/Router.src/M000109.html +0 -36
- data/doc/rdoc/classes/ESI/Router.src/M000110.html +0 -25
- data/doc/rdoc/classes/ESI/RubyCache.html +0 -278
- data/doc/rdoc/classes/ESI/RubyCache.src/M000100.html +0 -20
- data/doc/rdoc/classes/ESI/RubyCache.src/M000101.html +0 -20
- data/doc/rdoc/classes/ESI/RubyCache.src/M000102.html +0 -20
- data/doc/rdoc/classes/ESI/RubyCache.src/M000103.html +0 -22
- data/doc/rdoc/classes/ESI/RubyCache.src/M000104.html +0 -18
- data/doc/rdoc/classes/ESI/RubyCache.src/M000105.html +0 -22
- data/doc/rdoc/classes/ESI/RubyCache.src/M000106.html +0 -18
- data/doc/rdoc/classes/ESI/RubyCache.src/M000107.html +0 -18
- data/doc/rdoc/classes/ESI/RubyCache.src/M000108.html +0 -18
- data/doc/rdoc/classes/ESI/Tag.html +0 -141
- data/doc/rdoc/classes/ESI/Tag/Attempt.html +0 -113
- data/doc/rdoc/classes/ESI/Tag/Base.html +0 -237
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000026.html +0 -23
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000027.html +0 -22
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000028.html +0 -22
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000029.html +0 -17
- data/doc/rdoc/classes/ESI/Tag/Container.html +0 -206
- data/doc/rdoc/classes/ESI/Tag/Container.src/M000015.html +0 -20
- data/doc/rdoc/classes/ESI/Tag/Container.src/M000016.html +0 -22
- data/doc/rdoc/classes/ESI/Tag/Container.src/M000017.html +0 -25
- data/doc/rdoc/classes/ESI/Tag/Except.html +0 -184
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000018.html +0 -21
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000019.html +0 -20
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000020.html +0 -18
- data/doc/rdoc/classes/ESI/Tag/Include.html +0 -257
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000005.html +0 -20
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000006.html +0 -18
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000007.html +0 -34
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000008.html +0 -22
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000009.html +0 -27
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000010.html +0 -30
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000011.html +0 -51
- data/doc/rdoc/classes/ESI/Tag/Include/Request.html +0 -199
- data/doc/rdoc/classes/ESI/Tag/Include/Request.src/M000012.html +0 -18
- data/doc/rdoc/classes/ESI/Tag/Include/Request.src/M000013.html +0 -44
- data/doc/rdoc/classes/ESI/Tag/Include/Request/Error.html +0 -155
- data/doc/rdoc/classes/ESI/Tag/Include/Request/Error.src/M000014.html +0 -19
- data/doc/rdoc/classes/ESI/Tag/Invalidate.html +0 -171
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000023.html +0 -19
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000024.html +0 -51
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000025.html +0 -19
- data/doc/rdoc/classes/ESI/Tag/Try.html +0 -154
- data/doc/rdoc/classes/ESI/Tag/Try.src/M000021.html +0 -38
- data/doc/rdoc/classes/ESI/Tag/Try.src/M000022.html +0 -18
- data/doc/rdoc/classes/MultiDirHandler.html +0 -198
- data/doc/rdoc/classes/MultiDirHandler.src/M000001.html +0 -20
- data/doc/rdoc/classes/MultiDirHandler.src/M000002.html +0 -28
- data/doc/rdoc/classes/MultiDirHandler.src/M000003.html +0 -22
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/COPYING.html +0 -167
- data/doc/rdoc/files/LICENSE.html +0 -605
- data/doc/rdoc/files/README.html +0 -361
- data/doc/rdoc/files/ext/esi/common_rl.html +0 -160
- data/doc/rdoc/files/ext/esi/esi_parser_c.html +0 -101
- data/doc/rdoc/files/ext/esi/parser_c.html +0 -101
- data/doc/rdoc/files/ext/esi/parser_h.html +0 -101
- data/doc/rdoc/files/ext/esi/parser_rl.html +0 -867
- data/doc/rdoc/files/ext/esi/test/test_c.html +0 -101
- data/doc/rdoc/files/lib/esi/cache_rb.html +0 -120
- data/doc/rdoc/files/lib/esi/config_rb.html +0 -115
- data/doc/rdoc/files/lib/esi/dispatcher_rb.html +0 -110
- data/doc/rdoc/files/lib/esi/invalidator_rb.html +0 -114
- data/doc/rdoc/files/lib/esi/logger_rb.html +0 -108
- data/doc/rdoc/files/lib/esi/parser_rb.html +0 -120
- data/doc/rdoc/files/lib/esi/processor_rb.html +0 -115
- data/doc/rdoc/files/lib/esi/proxy_rb.html +0 -123
- data/doc/rdoc/files/lib/esi/rack_adapter_rb.html +0 -117
- data/doc/rdoc/files/lib/esi/response_rb.html +0 -116
- data/doc/rdoc/files/lib/esi/router_rb.html +0 -107
- data/doc/rdoc/files/lib/esi/tag/attempt_rb.html +0 -114
- data/doc/rdoc/files/lib/esi/tag/base_rb.html +0 -114
- data/doc/rdoc/files/lib/esi/tag/container_rb.html +0 -115
- data/doc/rdoc/files/lib/esi/tag/except_rb.html +0 -114
- data/doc/rdoc/files/lib/esi/tag/include_rb.html +0 -116
- data/doc/rdoc/files/lib/esi/tag/invalidate_rb.html +0 -115
- data/doc/rdoc/files/lib/esi/tag/try_rb.html +0 -115
- data/doc/rdoc/files/lib/esi/version_rb.html +0 -101
- data/doc/rdoc/files/lib/multi_dirhandler_rb.html +0 -109
- data/doc/rdoc/fr_class_index.html +0 -57
- data/doc/rdoc/fr_file_index.html +0 -55
- data/doc/rdoc/fr_method_index.html +0 -139
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -208
|
@@ -1,17 +0,0 @@
|
|
|
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::Cache)</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/cache.rb, line 53</span>
|
|
14
|
-
53: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
|
15
|
-
54: <span class="ruby-keyword kw">end</span></pre>
|
|
16
|
-
</body>
|
|
17
|
-
</html>
|
|
@@ -1,20 +0,0 @@
|
|
|
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>cache_key (ESI::Cache)</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/cache.rb, line 57</span>
|
|
14
|
-
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_key</span>( <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> )
|
|
15
|
-
58: <span class="ruby-identifier">http_x_requested_with</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value str">'HTTP_X_REQUESTED_WITH'</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">params</span>[<span class="ruby-value str">"X-Requested-With"</span>]
|
|
16
|
-
59: <span class="ruby-identifier">key</span> = <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-node">"#{uri}-#{http_x_requested_with}"</span>)
|
|
17
|
-
60: <span class="ruby-identifier">key</span>
|
|
18
|
-
61: <span class="ruby-keyword kw">end</span></pre>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
@@ -1,314 +0,0 @@
|
|
|
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>Class: ESI::Config</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="classHeader">
|
|
50
|
-
<table class="header-table">
|
|
51
|
-
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>Class</strong></td>
|
|
53
|
-
<td class="class-name-in-header">ESI::Config</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../../files/lib/esi/config_rb.html">
|
|
59
|
-
lib/esi/config.rb
|
|
60
|
-
</a>
|
|
61
|
-
<br />
|
|
62
|
-
</td>
|
|
63
|
-
</tr>
|
|
64
|
-
|
|
65
|
-
<tr class="top-aligned-row">
|
|
66
|
-
<td><strong>Parent:</strong></td>
|
|
67
|
-
<td>
|
|
68
|
-
Object
|
|
69
|
-
</td>
|
|
70
|
-
</tr>
|
|
71
|
-
</table>
|
|
72
|
-
</div>
|
|
73
|
-
<!-- banner header -->
|
|
74
|
-
|
|
75
|
-
<div id="bodyContent">
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<div id="contextContent">
|
|
80
|
-
|
|
81
|
-
<div id="description">
|
|
82
|
-
<p>
|
|
83
|
-
This file provides configuration options to mongrel-<a
|
|
84
|
-
href="Config.html#M000053">esi</a> Mongrel ESI is a proxy caching server
|
|
85
|
-
with limited load balancing capablities
|
|
86
|
-
</p>
|
|
87
|
-
<pre>
|
|
88
|
-
ESI::Config.define(listeners) do|config|
|
|
89
|
-
|
|
90
|
-
# define the caching rules globally for all routes, defaults to ruby
|
|
91
|
-
config.cache do|c|
|
|
92
|
-
c.memcached do|mc|
|
|
93
|
-
mc.servers = ['localhost:11211'] # memcahed servers
|
|
94
|
-
mc.namespace = 'mesi' # namespace for cache storage
|
|
95
|
-
end
|
|
96
|
-
c.ttl = 600 # default fragment time to live, when <esi:include does not include the max-age attribute
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
# define rules for when to enable esi processing globally for all routes
|
|
100
|
-
# using content type it is more flexible, but sometimes you will want to be
|
|
101
|
-
# explicit about when to enable esi processing. For those cases, enable_for_surrogate_only will
|
|
102
|
-
# require the presense of the Surrogate-Control header to contain the content="ESI/1.0" line.
|
|
103
|
-
# see [http://www.w3.org/TR/edge-arch Edge Arch] for details.
|
|
104
|
-
config.esi do|c|
|
|
105
|
-
c.allowed_content_types = ['text/plain', 'text/html']
|
|
106
|
-
#c.enable_for_surrogate_only = true # default is false
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
# define request path routing rules, these rules match against request path to select a specific server
|
|
110
|
-
config.routes do|s|
|
|
111
|
-
#s.match( /content/ ) do|r|
|
|
112
|
-
# r.servers = ['127.0.0.1:4000']
|
|
113
|
-
#end
|
|
114
|
-
s.default do|r|
|
|
115
|
-
r.servers = ['127.0.0.1:3000']
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
end
|
|
120
|
-
</pre>
|
|
121
|
-
|
|
122
|
-
</div>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
</div>
|
|
126
|
-
|
|
127
|
-
<div id="method-list">
|
|
128
|
-
<h3 class="section-bar">Methods</h3>
|
|
129
|
-
|
|
130
|
-
<div class="name-list">
|
|
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>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
</div>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<!-- if includes -->
|
|
146
|
-
|
|
147
|
-
<div id="section">
|
|
148
|
-
|
|
149
|
-
<div id="class-list">
|
|
150
|
-
<h3 class="section-bar">Classes and Modules</h3>
|
|
151
|
-
|
|
152
|
-
Class <a href="Config/CacheConfig.html" class="link">ESI::Config::CacheConfig</a><br />
|
|
153
|
-
Class <a href="Config/ConfigRouter.html" class="link">ESI::Config::ConfigRouter</a><br />
|
|
154
|
-
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
<div id="attribute-list">
|
|
161
|
-
<h3 class="section-bar">Attributes</h3>
|
|
162
|
-
|
|
163
|
-
<div class="name-list">
|
|
164
|
-
<table>
|
|
165
|
-
<tr class="top-aligned-row context-row">
|
|
166
|
-
<td class="context-item-name">config</td>
|
|
167
|
-
<td class="context-item-value"> [R] </td>
|
|
168
|
-
<td class="context-item-desc"></td>
|
|
169
|
-
</tr>
|
|
170
|
-
</table>
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
<!-- if method_list -->
|
|
177
|
-
<div id="methods">
|
|
178
|
-
<h3 class="section-bar">Public Class methods</h3>
|
|
179
|
-
|
|
180
|
-
<div id="method-M000056" class="method-detail">
|
|
181
|
-
<a name="M000056"></a>
|
|
182
|
-
|
|
183
|
-
<div class="method-heading">
|
|
184
|
-
<a href="Config.src/M000056.html" target="Code" class="method-signature"
|
|
185
|
-
onclick="popupCode('Config.src/M000056.html');return false;">
|
|
186
|
-
<span class="method-name">define</span><span class="method-args">( listeners ) {|config| ...}</span>
|
|
187
|
-
</a>
|
|
188
|
-
</div>
|
|
189
|
-
|
|
190
|
-
<div class="method-description">
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
|
|
194
|
-
<div id="method-M000049" class="method-detail">
|
|
195
|
-
<a name="M000049"></a>
|
|
196
|
-
|
|
197
|
-
<div class="method-heading">
|
|
198
|
-
<a href="Config.src/M000049.html" target="Code" class="method-signature"
|
|
199
|
-
onclick="popupCode('Config.src/M000049.html');return false;">
|
|
200
|
-
<span class="method-name">new</span><span class="method-args">(options)</span>
|
|
201
|
-
</a>
|
|
202
|
-
</div>
|
|
203
|
-
|
|
204
|
-
<div class="method-description">
|
|
205
|
-
</div>
|
|
206
|
-
</div>
|
|
207
|
-
|
|
208
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
|
209
|
-
|
|
210
|
-
<div id="method-M000050" class="method-detail">
|
|
211
|
-
<a name="M000050"></a>
|
|
212
|
-
|
|
213
|
-
<div class="method-heading">
|
|
214
|
-
<a href="Config.src/M000050.html" target="Code" class="method-signature"
|
|
215
|
-
onclick="popupCode('Config.src/M000050.html');return false;">
|
|
216
|
-
<span class="method-name">[]</span><span class="method-args">(key)</span>
|
|
217
|
-
</a>
|
|
218
|
-
</div>
|
|
219
|
-
|
|
220
|
-
<div class="method-description">
|
|
221
|
-
<p>
|
|
222
|
-
access configuration values
|
|
223
|
-
</p>
|
|
224
|
-
</div>
|
|
225
|
-
</div>
|
|
226
|
-
|
|
227
|
-
<div id="method-M000052" class="method-detail">
|
|
228
|
-
<a name="M000052"></a>
|
|
229
|
-
|
|
230
|
-
<div class="method-heading">
|
|
231
|
-
<a href="Config.src/M000052.html" target="Code" class="method-signature"
|
|
232
|
-
onclick="popupCode('Config.src/M000052.html');return false;">
|
|
233
|
-
<span class="method-name">cache</span><span class="method-args">() {|cache_options| ...}</span>
|
|
234
|
-
</a>
|
|
235
|
-
</div>
|
|
236
|
-
|
|
237
|
-
<div class="method-description">
|
|
238
|
-
<p>
|
|
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
|
|
241
|
-
ruby as in uses this process the options allowed are ruby and memcache
|
|
242
|
-
</p>
|
|
243
|
-
</div>
|
|
244
|
-
</div>
|
|
245
|
-
|
|
246
|
-
<div id="method-M000051" class="method-detail">
|
|
247
|
-
<a name="M000051"></a>
|
|
248
|
-
|
|
249
|
-
<div class="method-heading">
|
|
250
|
-
<a href="Config.src/M000051.html" target="Code" class="method-signature"
|
|
251
|
-
onclick="popupCode('Config.src/M000051.html');return false;">
|
|
252
|
-
<span class="method-name">enable_esi_processor?</span><span class="method-args">( headers )</span>
|
|
253
|
-
</a>
|
|
254
|
-
</div>
|
|
255
|
-
|
|
256
|
-
<div class="method-description">
|
|
257
|
-
</div>
|
|
258
|
-
</div>
|
|
259
|
-
|
|
260
|
-
<div id="method-M000053" class="method-detail">
|
|
261
|
-
<a name="M000053"></a>
|
|
262
|
-
|
|
263
|
-
<div class="method-heading">
|
|
264
|
-
<a href="Config.src/M000053.html" target="Code" class="method-signature"
|
|
265
|
-
onclick="popupCode('Config.src/M000053.html');return false;">
|
|
266
|
-
<span class="method-name">esi</span><span class="method-args">() {|options| ...}</span>
|
|
267
|
-
</a>
|
|
268
|
-
</div>
|
|
269
|
-
|
|
270
|
-
<div class="method-description">
|
|
271
|
-
</div>
|
|
272
|
-
</div>
|
|
273
|
-
|
|
274
|
-
<div id="method-M000054" class="method-detail">
|
|
275
|
-
<a name="M000054"></a>
|
|
276
|
-
|
|
277
|
-
<div class="method-heading">
|
|
278
|
-
<a href="Config.src/M000054.html" target="Code" class="method-signature"
|
|
279
|
-
onclick="popupCode('Config.src/M000054.html');return false;">
|
|
280
|
-
<span class="method-name">router</span><span class="method-args">()</span>
|
|
281
|
-
</a>
|
|
282
|
-
</div>
|
|
283
|
-
|
|
284
|
-
<div class="method-description">
|
|
285
|
-
</div>
|
|
286
|
-
</div>
|
|
287
|
-
|
|
288
|
-
<div id="method-M000055" class="method-detail">
|
|
289
|
-
<a name="M000055"></a>
|
|
290
|
-
|
|
291
|
-
<div class="method-heading">
|
|
292
|
-
<a href="Config.src/M000055.html" target="Code" class="method-signature"
|
|
293
|
-
onclick="popupCode('Config.src/M000055.html');return false;">
|
|
294
|
-
<span class="method-name">routes</span><span class="method-args">() {|config_router| ...}</span>
|
|
295
|
-
</a>
|
|
296
|
-
</div>
|
|
297
|
-
|
|
298
|
-
<div class="method-description">
|
|
299
|
-
</div>
|
|
300
|
-
</div>
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
</div>
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
</div>
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
<div id="validator-badges">
|
|
310
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
311
|
-
</div>
|
|
312
|
-
|
|
313
|
-
</body>
|
|
314
|
-
</html>
|
|
@@ -1,18 +0,0 @@
|
|
|
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>
|
|
@@ -1,18 +0,0 @@
|
|
|
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>[] (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 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
|
-
</body>
|
|
18
|
-
</html>
|
|
@@ -1,35 +0,0 @@
|
|
|
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>
|
|
@@ -1,40 +0,0 @@
|
|
|
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>cache (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 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>
|
|
39
|
-
</body>
|
|
40
|
-
</html>
|