mongrel_esi 0.4.0 → 0.4.1
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/README +8 -8
- data/Rakefile +4 -12
- data/doc/rdoc/classes/ESI.html +169 -0
- data/doc/rdoc/classes/ESI/Cache.html +178 -0
- data/doc/rdoc/classes/ESI/Cache.src/M000060.html +17 -0
- data/doc/rdoc/classes/ESI/Cache.src/M000061.html +20 -0
- data/doc/rdoc/classes/ESI/Config.html +291 -0
- data/doc/rdoc/classes/ESI/Config.src/M000043.html +18 -0
- data/doc/rdoc/classes/ESI/Config.src/M000044.html +18 -0
- data/doc/rdoc/classes/ESI/Config.src/M000045.html +35 -0
- data/doc/rdoc/classes/ESI/Config.src/M000046.html +38 -0
- data/doc/rdoc/classes/ESI/Config.src/M000047.html +23 -0
- data/doc/rdoc/classes/ESI/Config.src/M000048.html +18 -0
- data/doc/rdoc/classes/ESI/Config.src/M000049.html +20 -0
- data/doc/rdoc/classes/ESI/Config.src/M000050.html +18 -0
- data/doc/rdoc/classes/ESI/Config.src/M000051.html +24 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.html +212 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000055.html +19 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000056.html +19 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000057.html +18 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000058.html +18 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000059.html +18 -0
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.html +187 -0
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000052.html +19 -0
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000053.html +21 -0
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000054.html +21 -0
- data/doc/rdoc/classes/ESI/Dispatcher.html +172 -0
- data/doc/rdoc/classes/ESI/Dispatcher.src/M000062.html +23 -0
- data/doc/rdoc/classes/ESI/Dispatcher.src/M000063.html +20 -0
- data/doc/rdoc/classes/ESI/Fragment.html +218 -0
- data/doc/rdoc/classes/ESI/Fragment.src/M000076.html +21 -0
- data/doc/rdoc/classes/ESI/Fragment.src/M000077.html +18 -0
- data/doc/rdoc/classes/ESI/Fragment.src/M000078.html +18 -0
- data/doc/rdoc/classes/ESI/Handler.html +236 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000079.html +19 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000080.html +161 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000081.html +24 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000082.html +18 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000083.html +26 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000084.html +30 -0
- data/doc/rdoc/classes/ESI/Invalidator.html +131 -0
- data/doc/rdoc/classes/ESI/Invalidator.src/M000004.html +41 -0
- data/doc/rdoc/classes/ESI/Log.html +251 -0
- data/doc/rdoc/classes/ESI/Log.src/M000005.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000006.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000007.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000008.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000009.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000010.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000011.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000012.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000013.html +18 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.html +314 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000034.html +24 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000035.html +22 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000036.html +19 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000037.html +23 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000038.html +18 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000039.html +19 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000040.html +18 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000041.html +18 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000042.html +17 -0
- data/doc/rdoc/classes/ESI/Router.html +229 -0
- data/doc/rdoc/classes/ESI/Router.src/M000073.html +36 -0
- data/doc/rdoc/classes/ESI/Router.src/M000074.html +25 -0
- data/doc/rdoc/classes/ESI/Router.src/M000075.html +24 -0
- data/doc/rdoc/classes/ESI/RubyCache.html +278 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000064.html +20 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000065.html +22 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000066.html +21 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000067.html +22 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000068.html +18 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000069.html +22 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000070.html +18 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000071.html +18 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000072.html +18 -0
- data/doc/rdoc/classes/ESI/Tag.html +137 -0
- data/doc/rdoc/classes/ESI/Tag/Attempt.html +113 -0
- data/doc/rdoc/classes/ESI/Tag/Base.html +267 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000028.html +26 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000029.html +23 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000030.html +22 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000031.html +18 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000032.html +22 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000033.html +23 -0
- data/doc/rdoc/classes/ESI/Tag/Except.html +184 -0
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000020.html +21 -0
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000021.html +20 -0
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000022.html +18 -0
- data/doc/rdoc/classes/ESI/Tag/Include.html +189 -0
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000017.html +20 -0
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000018.html +18 -0
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000019.html +125 -0
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest.html +199 -0
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest.src/M000014.html +18 -0
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest.src/M000015.html +42 -0
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest/Error.html +155 -0
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest/Error.src/M000016.html +19 -0
- data/doc/rdoc/classes/ESI/Tag/Invalidate.html +171 -0
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000025.html +19 -0
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000026.html +51 -0
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000027.html +19 -0
- data/doc/rdoc/classes/ESI/Tag/Try.html +161 -0
- data/doc/rdoc/classes/ESI/Tag/Try.src/M000023.html +40 -0
- data/doc/rdoc/classes/ESI/Tag/Try.src/M000024.html +18 -0
- data/doc/rdoc/classes/MultiDirHandler.html +198 -0
- data/doc/rdoc/classes/MultiDirHandler.src/M000001.html +20 -0
- data/doc/rdoc/classes/MultiDirHandler.src/M000002.html +28 -0
- data/doc/rdoc/classes/MultiDirHandler.src/M000003.html +22 -0
- data/doc/rdoc/classes/Net.html +119 -0
- data/doc/rdoc/classes/Net/An.html +114 -0
- data/doc/rdoc/classes/Net/An/HTTP.html +137 -0
- data/doc/rdoc/classes/Net/An/HTTP.src/M000087.html +17 -0
- data/doc/rdoc/classes/Net/An/IORequest.html +139 -0
- data/doc/rdoc/classes/Net/An/IORequest.src/M000088.html +17 -0
- data/doc/rdoc/classes/Net/An/IOResponse.html +139 -0
- data/doc/rdoc/classes/Net/An/IOResponse.src/M000085.html +17 -0
- data/doc/rdoc/classes/Net/An/IOSocket.html +137 -0
- data/doc/rdoc/classes/Net/An/IOSocket.src/M000086.html +17 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/COPYING.html +168 -0
- data/doc/rdoc/files/LICENSE.html +605 -0
- data/doc/rdoc/files/README.html +361 -0
- data/doc/rdoc/files/lib/esi/cache_rb.html +113 -0
- data/doc/rdoc/files/lib/esi/config_rb.html +108 -0
- data/doc/rdoc/files/lib/esi/dispatcher_rb.html +109 -0
- data/doc/rdoc/files/lib/esi/handler_rb.html +121 -0
- data/doc/rdoc/files/lib/esi/invalidator_rb.html +117 -0
- data/doc/rdoc/files/lib/esi/logger_rb.html +108 -0
- data/doc/rdoc/files/lib/esi/router_rb.html +101 -0
- data/doc/rdoc/files/lib/esi/tag/attempt_rb.html +101 -0
- data/doc/rdoc/files/lib/esi/tag/base_rb.html +108 -0
- data/doc/rdoc/files/lib/esi/tag/except_rb.html +101 -0
- data/doc/rdoc/files/lib/esi/tag/include_rb.html +109 -0
- data/doc/rdoc/files/lib/esi/tag/invalidate_rb.html +109 -0
- data/doc/rdoc/files/lib/esi/tag/try_rb.html +108 -0
- data/doc/rdoc/files/lib/multi_dirhandler_rb.html +109 -0
- data/doc/rdoc/files/lib/net/ahttp_rb.html +109 -0
- data/doc/rdoc/fr_class_index.html +55 -0
- data/doc/rdoc/fr_file_index.html +44 -0
- data/doc/rdoc/fr_method_index.html +114 -0
- data/doc/rdoc/index.html +24 -0
- data/doc/rdoc/rdoc-style.css +208 -0
- data/ext/esi/esi_parser.c +36 -156
- data/ext/esi/test/parser.c +42 -43
- data/ext/esi/test1.rb +2 -2
- data/lib/esi/cache.rb +83 -72
- data/lib/esi/handler.rb +5 -20
- data/lib/multi_dirhandler.rb +13 -0
- data/lib/net/ahttp.rb +36 -0
- data/test/integration/handler_test.rb +1 -1
- metadata +222 -45
- data/test/unit/sample.html +0 -21
|
@@ -0,0 +1,24 @@
|
|
|
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::MemcachedCache)</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 98</span>
|
|
14
|
+
98: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">options</span> )
|
|
15
|
+
99: <span class="ruby-keyword kw">super</span>()
|
|
16
|
+
100: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">marshal_dump</span>
|
|
17
|
+
101: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge!</span>( <span class="ruby-identifier">:multithread</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span> )
|
|
18
|
+
102: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Using memcache with options => #{options.inspect}"</span>
|
|
19
|
+
103: <span class="ruby-ivar">@cache</span> = <span class="ruby-constant">MemCache</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">options</span>
|
|
20
|
+
104: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Using memcache servers at #{options[:servers].inspect}"</span>
|
|
21
|
+
105: <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">servers</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:servers</span>]
|
|
22
|
+
106: <span class="ruby-keyword kw">end</span></pre>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
@@ -0,0 +1,22 @@
|
|
|
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::MemcachedCache)</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 108</span>
|
|
14
|
+
108: <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
|
+
109: <span class="ruby-identifier">fragment</span> = <span class="ruby-identifier">get</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">params</span>)
|
|
16
|
+
110: <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>
|
|
17
|
+
111: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> <span class="ruby-comment cmt"># never raise an exception from this method</span>
|
|
18
|
+
112: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"error in #{__FILE__}:#{__LINE__}"</span>
|
|
19
|
+
113: <span class="ruby-keyword kw">false</span>
|
|
20
|
+
114: <span class="ruby-keyword kw">end</span></pre>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
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::MemcachedCache)</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 116</span>
|
|
14
|
+
116: <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
|
+
117: <span class="ruby-identifier">fragment</span> = <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">cache_key</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">params</span>))
|
|
16
|
+
118: <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">respond_to?</span>(<span class="ruby-identifier">:dup</span>)
|
|
17
|
+
119: <span class="ruby-keyword kw">end</span></pre>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
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::MemcachedCache)</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 121</span>
|
|
14
|
+
121: <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
|
+
122: <span class="ruby-identifier">fragment</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>)
|
|
16
|
+
123: <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>)
|
|
17
|
+
124: <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">add</span>( <span class="ruby-identifier">key</span>, <span class="ruby-identifier">fragment</span>, <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">max_age</span> )
|
|
18
|
+
125: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
|
19
|
+
126: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"error in #{__FILE__}:#{__LINE__}"</span>
|
|
20
|
+
127: <span class="ruby-identifier">log_error</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
|
|
21
|
+
128: <span class="ruby-keyword kw">end</span></pre>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -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>sweep! (ESI::MemcachedCache)</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 131</span>
|
|
14
|
+
131: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sweep!</span>
|
|
15
|
+
132: <span class="ruby-comment cmt"># TODO: not really a memcached equivalent??</span>
|
|
16
|
+
133: <span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
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>keys (ESI::MemcachedCache)</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 135</span>
|
|
14
|
+
135: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keys</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
15
|
+
136: <span class="ruby-comment cmt"># TODO: can't implement this method directly with memcached, unless we introduce another key</span>
|
|
16
|
+
137: <span class="ruby-comment cmt"># and increase the data, but it is possible...</span>
|
|
17
|
+
138: <span class="ruby-keyword kw">end</span></pre>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -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>delete (ESI::MemcachedCache)</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 140</span>
|
|
14
|
+
140: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>( <span class="ruby-identifier">key</span> )
|
|
15
|
+
141: <span class="ruby-identifier">delete_unlocked</span>
|
|
16
|
+
142: <span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -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>delete_unlocked (ESI::MemcachedCache)</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 144</span>
|
|
14
|
+
144: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_unlocked</span>( <span class="ruby-identifier">key</span> )
|
|
15
|
+
145: <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
|
|
16
|
+
146: <span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,17 @@
|
|
|
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_unlocked! (ESI::MemcachedCache)</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 148</span>
|
|
14
|
+
148: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sweep_unlocked!</span>
|
|
15
|
+
149: <span class="ruby-keyword kw">end</span></pre>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,229 @@
|
|
|
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::Router</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::Router</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/lib/esi/router_rb.html">
|
|
59
|
+
lib/esi/router.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
|
+
<a href="../ESI.html">ESI</a> Server is a reverse proxy caching server. It
|
|
84
|
+
will forward all requests to app servers by processing a config_file that
|
|
85
|
+
specifies routes:
|
|
86
|
+
</p>
|
|
87
|
+
<p>
|
|
88
|
+
content:
|
|
89
|
+
</p>
|
|
90
|
+
<pre>
|
|
91
|
+
host: 127.0.0.1
|
|
92
|
+
port: 3000
|
|
93
|
+
match_url: ^\/(content|samples|extra).*
|
|
94
|
+
</pre>
|
|
95
|
+
<p>
|
|
96
|
+
default:
|
|
97
|
+
</p>
|
|
98
|
+
<pre>
|
|
99
|
+
host: 127.0.0.1
|
|
100
|
+
port: 3001
|
|
101
|
+
</pre>
|
|
102
|
+
<p>
|
|
103
|
+
This sample configuration will route all urls starting with /content,
|
|
104
|
+
/samples, or /extras to the server running at 127.0.0.1 on port 3000
|
|
105
|
+
everything else that matches the .* will be routed to the server running on
|
|
106
|
+
port 3001 optionally the caching duration can be specificied explicity for
|
|
107
|
+
each host, this will be the default per host if the esi:include tag does
|
|
108
|
+
not specify otherwise
|
|
109
|
+
</p>
|
|
110
|
+
<p>
|
|
111
|
+
default:
|
|
112
|
+
</p>
|
|
113
|
+
<pre>
|
|
114
|
+
host: 127.0.01
|
|
115
|
+
port: 3001
|
|
116
|
+
cache_ttl: 300
|
|
117
|
+
</pre>
|
|
118
|
+
<p>
|
|
119
|
+
This example will cache all requests for 300 seconds, by default.
|
|
120
|
+
</p>
|
|
121
|
+
<p>
|
|
122
|
+
To create a router load either from memory or file the above YAML
|
|
123
|
+
</p>
|
|
124
|
+
<pre>
|
|
125
|
+
router = ESI::Router.new( YAML.load_file('config.yml') )
|
|
126
|
+
</pre>
|
|
127
|
+
<p>
|
|
128
|
+
or from memory
|
|
129
|
+
</p>
|
|
130
|
+
<pre>
|
|
131
|
+
router = ESI::Router.new( YAML.load(config_str) )
|
|
132
|
+
</pre>
|
|
133
|
+
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<div id="method-list">
|
|
140
|
+
<h3 class="section-bar">Methods</h3>
|
|
141
|
+
|
|
142
|
+
<div class="name-list">
|
|
143
|
+
<a href="#M000075">cache_ttl</a>
|
|
144
|
+
<a href="#M000073">new</a>
|
|
145
|
+
<a href="#M000074">url_for</a>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
<!-- if includes -->
|
|
153
|
+
|
|
154
|
+
<div id="section">
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
<!-- if method_list -->
|
|
164
|
+
<div id="methods">
|
|
165
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
166
|
+
|
|
167
|
+
<div id="method-M000073" class="method-detail">
|
|
168
|
+
<a name="M000073"></a>
|
|
169
|
+
|
|
170
|
+
<div class="method-heading">
|
|
171
|
+
<a href="Router.src/M000073.html" target="Code" class="method-signature"
|
|
172
|
+
onclick="popupCode('Router.src/M000073.html');return false;">
|
|
173
|
+
<span class="method-name">new</span><span class="method-args">( routes )</span>
|
|
174
|
+
</a>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<div class="method-description">
|
|
178
|
+
<p>
|
|
179
|
+
config is a routing table as defined above
|
|
180
|
+
</p>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
185
|
+
|
|
186
|
+
<div id="method-M000075" class="method-detail">
|
|
187
|
+
<a name="M000075"></a>
|
|
188
|
+
|
|
189
|
+
<div class="method-heading">
|
|
190
|
+
<a href="Router.src/M000075.html" target="Code" class="method-signature"
|
|
191
|
+
onclick="popupCode('Router.src/M000075.html');return false;">
|
|
192
|
+
<span class="method-name">cache_ttl</span><span class="method-args">( request_uri )</span>
|
|
193
|
+
</a>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
<div class="method-description">
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
<div id="method-M000074" class="method-detail">
|
|
201
|
+
<a name="M000074"></a>
|
|
202
|
+
|
|
203
|
+
<div class="method-heading">
|
|
204
|
+
<a href="Router.src/M000074.html" target="Code" class="method-signature"
|
|
205
|
+
onclick="popupCode('Router.src/M000074.html');return false;">
|
|
206
|
+
<span class="method-name">url_for</span><span class="method-args">( request_uri )</span>
|
|
207
|
+
</a>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div class="method-description">
|
|
211
|
+
<p>
|
|
212
|
+
return a uri given a request_uri
|
|
213
|
+
</p>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
</div>
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
<div id="validator-badges">
|
|
225
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
</body>
|
|
229
|
+
</html>
|
|
@@ -0,0 +1,36 @@
|
|
|
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 38</span>
|
|
14
|
+
38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">routes</span> )
|
|
15
|
+
39: <span class="ruby-ivar">@hosts</span> = []
|
|
16
|
+
40: <span class="ruby-ivar">@default</span> = <span class="ruby-keyword kw">nil</span>
|
|
17
|
+
41:
|
|
18
|
+
42: <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
|
+
43:
|
|
20
|
+
44: <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
|
+
45: <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
|
+
46: <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
|
+
47:
|
|
24
|
+
48: <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
|
+
49: <span class="ruby-ivar">@default</span> = <span class="ruby-identifier">cfg</span>
|
|
26
|
+
50: <span class="ruby-keyword kw">else</span>
|
|
27
|
+
51: <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
|
+
52: <span class="ruby-ivar">@hosts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">cfg</span>
|
|
29
|
+
53: <span class="ruby-keyword kw">end</span>
|
|
30
|
+
54:
|
|
31
|
+
55: <span class="ruby-keyword kw">end</span>
|
|
32
|
+
56:
|
|
33
|
+
57: <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
|
+
58: <span class="ruby-keyword kw">end</span></pre>
|
|
35
|
+
</body>
|
|
36
|
+
</html>
|