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,36 +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::Router)</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/router.rb, line 40</span>
|
|
14
|
-
40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">routes</span> )
|
|
15
|
-
41: <span class="ruby-ivar">@hosts</span> = []
|
|
16
|
-
42: <span class="ruby-ivar">@default</span> = <span class="ruby-keyword kw">nil</span>
|
|
17
|
-
43:
|
|
18
|
-
44: <span class="ruby-identifier">routes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">cfg</span><span class="ruby-operator">|</span>
|
|
19
|
-
45:
|
|
20
|
-
46: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Configuration error missing host for #{cfg.inspect}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:host</span>]
|
|
21
|
-
47: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Configuration error missing port for #{cfg.inspect}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:port</span>]
|
|
22
|
-
48: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Configuration error missing match_url for #{cfg.inspect}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:match_url</span>]
|
|
23
|
-
49:
|
|
24
|
-
50: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:match_url</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'default'</span>
|
|
25
|
-
51: <span class="ruby-ivar">@default</span> = <span class="ruby-identifier">cfg</span>
|
|
26
|
-
52: <span class="ruby-keyword kw">else</span>
|
|
27
|
-
53: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Configuration error missing match_url for #{cfg.inspect}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:match_url</span>]
|
|
28
|
-
54: <span class="ruby-ivar">@hosts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">cfg</span>
|
|
29
|
-
55: <span class="ruby-keyword kw">end</span>
|
|
30
|
-
56:
|
|
31
|
-
57: <span class="ruby-keyword kw">end</span>
|
|
32
|
-
58:
|
|
33
|
-
59: <span class="ruby-ivar">@default</span> = {<span class="ruby-identifier">:host</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'127.0.0.1'</span>, <span class="ruby-identifier">:port</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'3000'</span>} <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@default</span>
|
|
34
|
-
60: <span class="ruby-keyword kw">end</span></pre>
|
|
35
|
-
</body>
|
|
36
|
-
</html>
|
|
@@ -1,25 +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>url_for (ESI::Router)</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/router.rb, line 63</span>
|
|
14
|
-
63: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">url_for</span>( <span class="ruby-identifier">request_uri</span> )
|
|
15
|
-
64: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">request_uri</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_uri</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/http:\/\//</span>)
|
|
16
|
-
65: <span class="ruby-comment cmt"># locate the first entry to match the given uri</span>
|
|
17
|
-
66: <span class="ruby-identifier">config</span> = <span class="ruby-ivar">@hosts</span>.<span class="ruby-identifier">find</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cfg</span><span class="ruby-operator">|</span>
|
|
18
|
-
67: <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:match_url</span>]).<span class="ruby-identifier">match</span>(<span class="ruby-identifier">request_uri</span>)
|
|
19
|
-
68: <span class="ruby-keyword kw">end</span>
|
|
20
|
-
69: <span class="ruby-identifier">config</span> = <span class="ruby-ivar">@default</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">config</span>
|
|
21
|
-
70: <span class="ruby-comment cmt"># build a url given a valid config or abort 404 not found</span>
|
|
22
|
-
71: <span class="ruby-value str">"http://"</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">config</span>[<span class="ruby-identifier">:host</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">":"</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">config</span>[<span class="ruby-identifier">:port</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">""</span>).<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">request_uri</span>).<span class="ruby-identifier">squeeze</span>(<span class="ruby-value str">"/"</span>)
|
|
23
|
-
72: <span class="ruby-keyword kw">end</span></pre>
|
|
24
|
-
</body>
|
|
25
|
-
</html>
|
|
@@ -1,278 +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::RubyCache</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::RubyCache</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../../files/lib/esi/cache_rb.html">
|
|
59
|
-
lib/esi/cache.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
|
-
<a href="Cache.html">
|
|
69
|
-
Cache
|
|
70
|
-
</a>
|
|
71
|
-
</td>
|
|
72
|
-
</tr>
|
|
73
|
-
</table>
|
|
74
|
-
</div>
|
|
75
|
-
<!-- banner header -->
|
|
76
|
-
|
|
77
|
-
<div id="bodyContent">
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<div id="contextContent">
|
|
82
|
-
|
|
83
|
-
<div id="description">
|
|
84
|
-
<p>
|
|
85
|
-
A ruby thread safe cache, stores cached fragments in the current ruby
|
|
86
|
-
process memory
|
|
87
|
-
</p>
|
|
88
|
-
<p>
|
|
89
|
-
A hash table indexed by cache_key of Fragments. the cache is made thread
|
|
90
|
-
safe if the external invalidator is active otherwise the Mutex is a no op
|
|
91
|
-
</p>
|
|
92
|
-
<p>
|
|
93
|
-
Default cache.
|
|
94
|
-
</p>
|
|
95
|
-
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
</div>
|
|
100
|
-
|
|
101
|
-
<div id="method-list">
|
|
102
|
-
<h3 class="section-bar">Methods</h3>
|
|
103
|
-
|
|
104
|
-
<div class="name-list">
|
|
105
|
-
<a href="#M000101">cached?</a>
|
|
106
|
-
<a href="#M000106">delete</a>
|
|
107
|
-
<a href="#M000107">delete_unlocked</a>
|
|
108
|
-
<a href="#M000102">get</a>
|
|
109
|
-
<a href="#M000105">keys</a>
|
|
110
|
-
<a href="#M000100">new</a>
|
|
111
|
-
<a href="#M000103">put</a>
|
|
112
|
-
<a href="#M000104">sweep!</a>
|
|
113
|
-
<a href="#M000108">sweep_unlocked!</a>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
<!-- if includes -->
|
|
121
|
-
|
|
122
|
-
<div id="section">
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<!-- if method_list -->
|
|
132
|
-
<div id="methods">
|
|
133
|
-
<h3 class="section-bar">Public Class methods</h3>
|
|
134
|
-
|
|
135
|
-
<div id="method-M000100" class="method-detail">
|
|
136
|
-
<a name="M000100"></a>
|
|
137
|
-
|
|
138
|
-
<div class="method-heading">
|
|
139
|
-
<a href="RubyCache.src/M000100.html" target="Code" class="method-signature"
|
|
140
|
-
onclick="popupCode('RubyCache.src/M000100.html');return false;">
|
|
141
|
-
<span class="method-name">new</span><span class="method-args">( options = {} )</span>
|
|
142
|
-
</a>
|
|
143
|
-
</div>
|
|
144
|
-
|
|
145
|
-
<div class="method-description">
|
|
146
|
-
</div>
|
|
147
|
-
</div>
|
|
148
|
-
|
|
149
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
|
150
|
-
|
|
151
|
-
<div id="method-M000101" class="method-detail">
|
|
152
|
-
<a name="M000101"></a>
|
|
153
|
-
|
|
154
|
-
<div class="method-heading">
|
|
155
|
-
<a href="RubyCache.src/M000101.html" target="Code" class="method-signature"
|
|
156
|
-
onclick="popupCode('RubyCache.src/M000101.html');return false;">
|
|
157
|
-
<span class="method-name">cached?</span><span class="method-args">( uri, params )</span>
|
|
158
|
-
</a>
|
|
159
|
-
</div>
|
|
160
|
-
|
|
161
|
-
<div class="method-description">
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
|
|
165
|
-
<div id="method-M000106" class="method-detail">
|
|
166
|
-
<a name="M000106"></a>
|
|
167
|
-
|
|
168
|
-
<div class="method-heading">
|
|
169
|
-
<a href="RubyCache.src/M000106.html" target="Code" class="method-signature"
|
|
170
|
-
onclick="popupCode('RubyCache.src/M000106.html');return false;">
|
|
171
|
-
<span class="method-name">delete</span><span class="method-args">( key )</span>
|
|
172
|
-
</a>
|
|
173
|
-
</div>
|
|
174
|
-
|
|
175
|
-
<div class="method-description">
|
|
176
|
-
</div>
|
|
177
|
-
</div>
|
|
178
|
-
|
|
179
|
-
<div id="method-M000107" class="method-detail">
|
|
180
|
-
<a name="M000107"></a>
|
|
181
|
-
|
|
182
|
-
<div class="method-heading">
|
|
183
|
-
<a href="RubyCache.src/M000107.html" target="Code" class="method-signature"
|
|
184
|
-
onclick="popupCode('RubyCache.src/M000107.html');return false;">
|
|
185
|
-
<span class="method-name">delete_unlocked</span><span class="method-args">( key )</span>
|
|
186
|
-
</a>
|
|
187
|
-
</div>
|
|
188
|
-
|
|
189
|
-
<div class="method-description">
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
|
|
193
|
-
<div id="method-M000102" class="method-detail">
|
|
194
|
-
<a name="M000102"></a>
|
|
195
|
-
|
|
196
|
-
<div class="method-heading">
|
|
197
|
-
<a href="RubyCache.src/M000102.html" target="Code" class="method-signature"
|
|
198
|
-
onclick="popupCode('RubyCache.src/M000102.html');return false;">
|
|
199
|
-
<span class="method-name">get</span><span class="method-args">( uri, params )</span>
|
|
200
|
-
</a>
|
|
201
|
-
</div>
|
|
202
|
-
|
|
203
|
-
<div class="method-description">
|
|
204
|
-
</div>
|
|
205
|
-
</div>
|
|
206
|
-
|
|
207
|
-
<div id="method-M000105" class="method-detail">
|
|
208
|
-
<a name="M000105"></a>
|
|
209
|
-
|
|
210
|
-
<div class="method-heading">
|
|
211
|
-
<a href="RubyCache.src/M000105.html" target="Code" class="method-signature"
|
|
212
|
-
onclick="popupCode('RubyCache.src/M000105.html');return false;">
|
|
213
|
-
<span class="method-name">keys</span><span class="method-args">() {|key, data| ...}</span>
|
|
214
|
-
</a>
|
|
215
|
-
</div>
|
|
216
|
-
|
|
217
|
-
<div class="method-description">
|
|
218
|
-
</div>
|
|
219
|
-
</div>
|
|
220
|
-
|
|
221
|
-
<div id="method-M000103" class="method-detail">
|
|
222
|
-
<a name="M000103"></a>
|
|
223
|
-
|
|
224
|
-
<div class="method-heading">
|
|
225
|
-
<a href="RubyCache.src/M000103.html" target="Code" class="method-signature"
|
|
226
|
-
onclick="popupCode('RubyCache.src/M000103.html');return false;">
|
|
227
|
-
<span class="method-name">put</span><span class="method-args">( uri, params, max_age, body )</span>
|
|
228
|
-
</a>
|
|
229
|
-
</div>
|
|
230
|
-
|
|
231
|
-
<div class="method-description">
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
|
|
235
|
-
<div id="method-M000104" class="method-detail">
|
|
236
|
-
<a name="M000104"></a>
|
|
237
|
-
|
|
238
|
-
<div class="method-heading">
|
|
239
|
-
<a href="RubyCache.src/M000104.html" target="Code" class="method-signature"
|
|
240
|
-
onclick="popupCode('RubyCache.src/M000104.html');return false;">
|
|
241
|
-
<span class="method-name">sweep!</span><span class="method-args">()</span>
|
|
242
|
-
</a>
|
|
243
|
-
</div>
|
|
244
|
-
|
|
245
|
-
<div class="method-description">
|
|
246
|
-
<p>
|
|
247
|
-
run through the cache and dump anything that has expired
|
|
248
|
-
</p>
|
|
249
|
-
</div>
|
|
250
|
-
</div>
|
|
251
|
-
|
|
252
|
-
<div id="method-M000108" class="method-detail">
|
|
253
|
-
<a name="M000108"></a>
|
|
254
|
-
|
|
255
|
-
<div class="method-heading">
|
|
256
|
-
<a href="RubyCache.src/M000108.html" target="Code" class="method-signature"
|
|
257
|
-
onclick="popupCode('RubyCache.src/M000108.html');return false;">
|
|
258
|
-
<span class="method-name">sweep_unlocked!</span><span class="method-args">()</span>
|
|
259
|
-
</a>
|
|
260
|
-
</div>
|
|
261
|
-
|
|
262
|
-
<div class="method-description">
|
|
263
|
-
</div>
|
|
264
|
-
</div>
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
</div>
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
</div>
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
<div id="validator-badges">
|
|
274
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
275
|
-
</div>
|
|
276
|
-
|
|
277
|
-
</body>
|
|
278
|
-
</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>new (ESI::RubyCache)</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 167</span>
|
|
14
|
-
167: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">options</span> = {} )
|
|
15
|
-
168: <span class="ruby-keyword kw">super</span>()
|
|
16
|
-
169: <span class="ruby-ivar">@semaphore</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
|
|
17
|
-
170: <span class="ruby-ivar">@cache</span> = {}
|
|
18
|
-
171: <span class="ruby-keyword kw">end</span></pre>
|
|
19
|
-
</body>
|
|
20
|
-
</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>cached? (ESI::RubyCache)</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 173</span>
|
|
14
|
-
173: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cached?</span>( <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> )
|
|
15
|
-
174: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">cache_key</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">params</span>)
|
|
16
|
-
175: <span class="ruby-identifier">fragment</span> = <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">key</span>] }
|
|
17
|
-
176: <span class="ruby-identifier">fragment</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">valid?</span>
|
|
18
|
-
177: <span class="ruby-keyword kw">end</span></pre>
|
|
19
|
-
</body>
|
|
20
|
-
</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>get (ESI::RubyCache)</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 179</span>
|
|
14
|
-
179: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>( <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> )
|
|
15
|
-
180: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">cache_key</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">params</span>)
|
|
16
|
-
181: <span class="ruby-identifier">fragment</span> = <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">key</span>] }
|
|
17
|
-
182: <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">dup</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fragment</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">valid?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:dup</span>)
|
|
18
|
-
183: <span class="ruby-keyword kw">end</span></pre>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
@@ -1,22 +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>put (ESI::RubyCache)</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 185</span>
|
|
14
|
-
185: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put</span>( <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span>, <span class="ruby-identifier">max_age</span>, <span class="ruby-identifier">body</span> )
|
|
15
|
-
186: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">cache_key</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">params</span>)
|
|
16
|
-
187: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
|
17
|
-
188: <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-constant">Fragment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">max_age</span>,<span class="ruby-identifier">body</span>)
|
|
18
|
-
189: <span class="ruby-identifier">sweep_unlocked!</span>
|
|
19
|
-
190: <span class="ruby-keyword kw">end</span>
|
|
20
|
-
191: <span class="ruby-keyword kw">end</span></pre>
|
|
21
|
-
</body>
|
|
22
|
-
</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>sweep! (ESI::RubyCache)</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 194</span>
|
|
14
|
-
194: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sweep!</span>
|
|
15
|
-
195: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-identifier">sweep_unlocked!</span> }
|
|
16
|
-
196: <span class="ruby-keyword kw">end</span></pre>
|
|
17
|
-
</body>
|
|
18
|
-
</html>
|