mongrel_esi 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +15 -8
- data/bin/mongrel_esi +0 -0
- data/ext/esi/common.rl +32 -27
- data/ext/esi/esi_parser.c +11 -4
- data/ext/esi/parser.c +4536 -901
- data/ext/esi/parser.h +7 -0
- data/ext/esi/parser.rl +171 -53
- data/ext/esi/run-test.rb +0 -0
- data/ext/esi/test/common.rl +32 -27
- data/ext/esi/test/parser.c +322 -1342
- data/ext/esi/test/parser.h +7 -0
- data/ext/esi/test/parser.rl +171 -53
- data/ext/esi/test/test.c +13 -4
- data/ext/esi/test1.rb +35 -3
- data/lib/esi/cache.rb +2 -1
- data/lib/esi/config.rb +37 -0
- data/lib/esi/dispatcher.rb +3 -5
- data/lib/esi/invalidator.rb +3 -0
- data/lib/esi/logger.rb +0 -7
- data/lib/esi/parser.rb +70 -0
- data/lib/esi/processor.rb +88 -0
- data/lib/esi/proxy.rb +104 -0
- data/lib/esi/response.rb +106 -0
- data/lib/esi/router.rb +3 -0
- data/lib/esi/tag/attempt.rb +3 -0
- data/lib/esi/tag/base.rb +3 -1
- data/lib/esi/tag/except.rb +2 -0
- data/lib/esi/tag/include.rb +131 -132
- data/lib/esi/tag/invalidate.rb +2 -0
- data/lib/esi/tag/try.rb +3 -0
- data/test/integration/basic_test.rb +0 -1
- data/test/integration/docs/esi_max_age_varies.html +10 -0
- data/test/integration/handler_test.rb +31 -5
- data/test/integration/help.rb +13 -1
- data/test/load_test.rb +133 -0
- data/test/unit/include_request_test.rb +1 -1
- data/test/unit/parser_test.rb +41 -5
- data/test/unit/response_test.rb +184 -0
- metadata +50 -224
- data/doc/rdoc/classes/ESI/Cache.html +0 -178
- data/doc/rdoc/classes/ESI/Cache.src/M000060.html +0 -17
- data/doc/rdoc/classes/ESI/Cache.src/M000061.html +0 -20
- data/doc/rdoc/classes/ESI/Config/CacheConfig.html +0 -212
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000055.html +0 -19
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000056.html +0 -19
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000057.html +0 -18
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000058.html +0 -18
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000059.html +0 -18
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.html +0 -187
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000052.html +0 -19
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000053.html +0 -21
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000054.html +0 -21
- data/doc/rdoc/classes/ESI/Config.html +0 -291
- data/doc/rdoc/classes/ESI/Config.src/M000043.html +0 -18
- data/doc/rdoc/classes/ESI/Config.src/M000044.html +0 -18
- data/doc/rdoc/classes/ESI/Config.src/M000045.html +0 -35
- data/doc/rdoc/classes/ESI/Config.src/M000046.html +0 -38
- data/doc/rdoc/classes/ESI/Config.src/M000047.html +0 -23
- data/doc/rdoc/classes/ESI/Config.src/M000048.html +0 -18
- data/doc/rdoc/classes/ESI/Config.src/M000049.html +0 -20
- data/doc/rdoc/classes/ESI/Config.src/M000050.html +0 -18
- data/doc/rdoc/classes/ESI/Config.src/M000051.html +0 -24
- data/doc/rdoc/classes/ESI/Dispatcher.html +0 -172
- data/doc/rdoc/classes/ESI/Dispatcher.src/M000062.html +0 -23
- data/doc/rdoc/classes/ESI/Dispatcher.src/M000063.html +0 -20
- data/doc/rdoc/classes/ESI/Fragment.html +0 -218
- data/doc/rdoc/classes/ESI/Fragment.src/M000076.html +0 -21
- data/doc/rdoc/classes/ESI/Fragment.src/M000077.html +0 -18
- data/doc/rdoc/classes/ESI/Fragment.src/M000078.html +0 -18
- data/doc/rdoc/classes/ESI/Handler.html +0 -236
- data/doc/rdoc/classes/ESI/Handler.src/M000079.html +0 -19
- data/doc/rdoc/classes/ESI/Handler.src/M000080.html +0 -161
- data/doc/rdoc/classes/ESI/Handler.src/M000081.html +0 -24
- data/doc/rdoc/classes/ESI/Handler.src/M000082.html +0 -18
- data/doc/rdoc/classes/ESI/Handler.src/M000083.html +0 -26
- data/doc/rdoc/classes/ESI/Handler.src/M000084.html +0 -30
- 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 -251
- data/doc/rdoc/classes/ESI/Log.src/M000005.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000006.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000007.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000008.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000009.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000010.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000011.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000012.html +0 -18
- data/doc/rdoc/classes/ESI/Log.src/M000013.html +0 -18
- data/doc/rdoc/classes/ESI/MemcachedCache.html +0 -314
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000034.html +0 -24
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000035.html +0 -22
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000036.html +0 -19
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000037.html +0 -23
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000038.html +0 -18
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000039.html +0 -19
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000040.html +0 -18
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000041.html +0 -18
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000042.html +0 -17
- data/doc/rdoc/classes/ESI/Router.html +0 -229
- data/doc/rdoc/classes/ESI/Router.src/M000073.html +0 -36
- data/doc/rdoc/classes/ESI/Router.src/M000074.html +0 -25
- data/doc/rdoc/classes/ESI/Router.src/M000075.html +0 -24
- data/doc/rdoc/classes/ESI/RubyCache.html +0 -278
- data/doc/rdoc/classes/ESI/RubyCache.src/M000064.html +0 -20
- data/doc/rdoc/classes/ESI/RubyCache.src/M000065.html +0 -22
- data/doc/rdoc/classes/ESI/RubyCache.src/M000066.html +0 -21
- data/doc/rdoc/classes/ESI/RubyCache.src/M000067.html +0 -22
- data/doc/rdoc/classes/ESI/RubyCache.src/M000068.html +0 -18
- data/doc/rdoc/classes/ESI/RubyCache.src/M000069.html +0 -22
- data/doc/rdoc/classes/ESI/RubyCache.src/M000070.html +0 -18
- data/doc/rdoc/classes/ESI/RubyCache.src/M000071.html +0 -18
- data/doc/rdoc/classes/ESI/RubyCache.src/M000072.html +0 -18
- data/doc/rdoc/classes/ESI/Tag/Attempt.html +0 -113
- data/doc/rdoc/classes/ESI/Tag/Base.html +0 -267
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000028.html +0 -26
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000029.html +0 -23
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000030.html +0 -22
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000031.html +0 -18
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000032.html +0 -22
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000033.html +0 -23
- data/doc/rdoc/classes/ESI/Tag/Except.html +0 -184
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000020.html +0 -21
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000021.html +0 -20
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000022.html +0 -18
- data/doc/rdoc/classes/ESI/Tag/Include.html +0 -189
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000017.html +0 -20
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000018.html +0 -18
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000019.html +0 -125
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest/Error.html +0 -155
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest/Error.src/M000016.html +0 -19
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest.html +0 -199
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest.src/M000014.html +0 -18
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest.src/M000015.html +0 -42
- data/doc/rdoc/classes/ESI/Tag/Invalidate.html +0 -171
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000025.html +0 -19
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000026.html +0 -51
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000027.html +0 -19
- data/doc/rdoc/classes/ESI/Tag/Try.html +0 -161
- data/doc/rdoc/classes/ESI/Tag/Try.src/M000023.html +0 -40
- data/doc/rdoc/classes/ESI/Tag/Try.src/M000024.html +0 -18
- data/doc/rdoc/classes/ESI/Tag.html +0 -137
- data/doc/rdoc/classes/ESI.html +0 -169
- 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/classes/Net/An/HTTP.html +0 -137
- data/doc/rdoc/classes/Net/An/HTTP.src/M000087.html +0 -17
- data/doc/rdoc/classes/Net/An/IORequest.html +0 -139
- data/doc/rdoc/classes/Net/An/IORequest.src/M000088.html +0 -17
- data/doc/rdoc/classes/Net/An/IOResponse.html +0 -139
- data/doc/rdoc/classes/Net/An/IOResponse.src/M000085.html +0 -17
- data/doc/rdoc/classes/Net/An/IOSocket.html +0 -137
- data/doc/rdoc/classes/Net/An/IOSocket.src/M000086.html +0 -17
- data/doc/rdoc/classes/Net/An.html +0 -114
- data/doc/rdoc/classes/Net.html +0 -119
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/COPYING.html +0 -168
- data/doc/rdoc/files/LICENSE.html +0 -605
- data/doc/rdoc/files/README.html +0 -361
- data/doc/rdoc/files/lib/esi/cache_rb.html +0 -113
- data/doc/rdoc/files/lib/esi/config_rb.html +0 -108
- data/doc/rdoc/files/lib/esi/dispatcher_rb.html +0 -109
- data/doc/rdoc/files/lib/esi/handler_rb.html +0 -121
- data/doc/rdoc/files/lib/esi/invalidator_rb.html +0 -117
- data/doc/rdoc/files/lib/esi/logger_rb.html +0 -108
- data/doc/rdoc/files/lib/esi/router_rb.html +0 -101
- data/doc/rdoc/files/lib/esi/tag/attempt_rb.html +0 -101
- data/doc/rdoc/files/lib/esi/tag/base_rb.html +0 -108
- data/doc/rdoc/files/lib/esi/tag/except_rb.html +0 -101
- data/doc/rdoc/files/lib/esi/tag/include_rb.html +0 -109
- data/doc/rdoc/files/lib/esi/tag/invalidate_rb.html +0 -109
- data/doc/rdoc/files/lib/esi/tag/try_rb.html +0 -108
- data/doc/rdoc/files/lib/multi_dirhandler_rb.html +0 -109
- data/doc/rdoc/files/lib/net/ahttp_rb.html +0 -109
- data/doc/rdoc/fr_class_index.html +0 -55
- data/doc/rdoc/fr_file_index.html +0 -44
- data/doc/rdoc/fr_method_index.html +0 -114
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -208
- data/ext/esi/parser.rb +0 -49
- data/ext/esi/ruby_esi.rl +0 -135
- data/lib/esi/handler.rb +0 -221
- data/lib/net/ahttp.rb +0 -36
data/doc/rdoc/files/README.html
DELETED
@@ -1,361 +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>File: README</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="fileHeader">
|
50
|
-
<h1>README</h1>
|
51
|
-
<table class="header-table">
|
52
|
-
<tr class="top-aligned-row">
|
53
|
-
<td><strong>Path:</strong></td>
|
54
|
-
<td>README
|
55
|
-
</td>
|
56
|
-
</tr>
|
57
|
-
<tr class="top-aligned-row">
|
58
|
-
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>Sat Jan 05 23:15:10 -0500 2008</td>
|
60
|
-
</tr>
|
61
|
-
</table>
|
62
|
-
</div>
|
63
|
-
<!-- banner header -->
|
64
|
-
|
65
|
-
<div id="bodyContent">
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<div id="contextContent">
|
70
|
-
|
71
|
-
<div id="description">
|
72
|
-
<h1>About</h1>
|
73
|
-
<p>
|
74
|
-
MongrelESI is meant to make caching easier by distributing the cache logic.
|
75
|
-
</p>
|
76
|
-
<p>
|
77
|
-
The idea is to represent each part of the page as a unique URL.
|
78
|
-
</p>
|
79
|
-
<p>
|
80
|
-
The whole page may not be cachable, but most of it probably is. The cache
|
81
|
-
server works by scanning the requested document for specific <esi:* tags
|
82
|
-
before servering the response. MongrelESI currently, only supports a few
|
83
|
-
basic instructions
|
84
|
-
</p>
|
85
|
-
<h1>Tags</h1>
|
86
|
-
<p>
|
87
|
-
esi:include:
|
88
|
-
</p>
|
89
|
-
<pre>
|
90
|
-
src - request path, response replaces esi:include tag
|
91
|
-
timeout - how long to wait on the response
|
92
|
-
max-age - how long to cache the entity
|
93
|
-
onerror - whether continue on errors or trigger an exception
|
94
|
-
</pre>
|
95
|
-
<p>
|
96
|
-
esi:invalidate:
|
97
|
-
</p>
|
98
|
-
<pre>
|
99
|
-
encloses invalidation instructions.
|
100
|
-
these instructions currently only support basic invalidation
|
101
|
-
e.g.
|
102
|
-
<esi:invalidate output="no">
|
103
|
-
<?xml version="1.0"?>
|
104
|
-
<!DOCTYPE INVALIDATION SYSTEM "internal:///WCSinvalidation.dtd">
|
105
|
-
<INVALIDATION VERSION="WCS-1.1">
|
106
|
-
<OBJECT>
|
107
|
-
<BASICSELECTOR URI="/path/to/invalidate"/>
|
108
|
-
<ACTION REMOVALTTL="0"/>
|
109
|
-
<INFO VALUE="invalidating fragment test 1"/>
|
110
|
-
</OBJECT>
|
111
|
-
</INVALIDATION>
|
112
|
-
</esi:invalidate>
|
113
|
-
|
114
|
-
In the above example, only /path/to/invalidate will be invalidated, advanced regex style selectors are only support with ruby as the
|
115
|
-
cache storage.
|
116
|
-
</pre>
|
117
|
-
<p>
|
118
|
-
esi:try/esi:attempt/esi:except
|
119
|
-
</p>
|
120
|
-
<pre>
|
121
|
-
if any tags within the attempt block raise an exception and the onerror attribute is not equal to continue then
|
122
|
-
the server will fall back to the markup within the except block
|
123
|
-
</pre>
|
124
|
-
<h1>Proxy Config</h1>
|
125
|
-
<p>
|
126
|
-
MongrelESI is a proxy server. To configure where requests should be proxied
|
127
|
-
modify the config/routes.yml file.
|
128
|
-
</p>
|
129
|
-
<p>
|
130
|
-
Here‘s an example:
|
131
|
-
</p>
|
132
|
-
<p>
|
133
|
-
ESI::Config.define(listeners) do|config|
|
134
|
-
</p>
|
135
|
-
<pre>
|
136
|
-
# define request path routing rules
|
137
|
-
config.routes do|s|
|
138
|
-
s.match( /^\/(content|samples|extras).*/ ) do|r|
|
139
|
-
r.servers = ['127.0.0.1:4000']
|
140
|
-
end
|
141
|
-
s.default do|r|
|
142
|
-
r.servers = ['127.0.0.1:3000']
|
143
|
-
end
|
144
|
-
end
|
145
|
-
</pre>
|
146
|
-
<p>
|
147
|
-
end
|
148
|
-
</p>
|
149
|
-
<p>
|
150
|
-
This sample configuration will route all urls starting with /content,
|
151
|
-
/samples, or /extras to the servers running at 127.0.0.1 on port 4000.
|
152
|
-
Everything else that matches the .* will be routed to the server running on
|
153
|
-
port 3000. Optionally the caching duration can be specificied explicity for
|
154
|
-
each host
|
155
|
-
</p>
|
156
|
-
<p>
|
157
|
-
s.default do|r|
|
158
|
-
</p>
|
159
|
-
<pre>
|
160
|
-
r.servers = ['127.0.0.1:3000']
|
161
|
-
r.cache_ttl = 300
|
162
|
-
</pre>
|
163
|
-
<p>
|
164
|
-
end
|
165
|
-
</p>
|
166
|
-
<p>
|
167
|
-
This example will cache all requests for 300 seconds, but normally you
|
168
|
-
would want to set the ttl on each individual fragment or include.
|
169
|
-
</p>
|
170
|
-
<p>
|
171
|
-
A typical include would look like the following:
|
172
|
-
</p>
|
173
|
-
<p>
|
174
|
-
<esi:include src="/content/1" max-age="600+600"/>
|
175
|
-
</p>
|
176
|
-
<p>
|
177
|
-
Requesting /home, might respond with the following:
|
178
|
-
</p>
|
179
|
-
<p>
|
180
|
-
<html> <head><title>Your Page</title> </head>
|
181
|
-
<body> <div class="header"><esi:include
|
182
|
-
src="/content/1 max-age="600+600"/></div>
|
183
|
-
<div>Some content</div> <div>Some more
|
184
|
-
content</div> </body> </html>
|
185
|
-
</p>
|
186
|
-
<p>
|
187
|
-
If the uri is not already cached, the cache server will request /content/1,
|
188
|
-
which will respond with:
|
189
|
-
</p>
|
190
|
-
<p>
|
191
|
-
<div>hello User42</div>
|
192
|
-
</p>
|
193
|
-
<p>
|
194
|
-
And finally, MongrelESI will respond to the original client request with
|
195
|
-
the combined documents: <html> <head><title>Your
|
196
|
-
Page</title> </head> <body> <div
|
197
|
-
class="header"><div>hello User42</div></div>
|
198
|
-
<div>Some content</div> <div>Some more
|
199
|
-
content</div> </body> </html>
|
200
|
-
</p>
|
201
|
-
<h2>Integrating with your applications</h2>
|
202
|
-
<p>
|
203
|
-
MongrelESI was built to support integrating lots of applications together.
|
204
|
-
</p>
|
205
|
-
<p>
|
206
|
-
Primarily, you‘ll want to integrate by having one base application
|
207
|
-
and many tiny applications that surface within your primary application. In
|
208
|
-
the rails sense think components. In a bigger sense think multiple
|
209
|
-
application technologies all integrating into the same application. Imagine
|
210
|
-
a java application returning up to the minute chat conversations in one
|
211
|
-
part of the page, while rails delivers a reliable listing of current forum
|
212
|
-
discussion, and maybe a python presense indicator for forum posts…
|
213
|
-
</p>
|
214
|
-
<p>
|
215
|
-
One thing to keep in mind is mongrel esi is a proxy server. This means for
|
216
|
-
each request it needs to know where to route the requests. To support this
|
217
|
-
config.rb can express any regex to match a url and determine where a
|
218
|
-
request should be forwarded as well as defining a default route.
|
219
|
-
</p>
|
220
|
-
<p>
|
221
|
-
It is also sometimes convenient to allow multiple applications to store or
|
222
|
-
house static content. For this to work mongrel esi needs to know in what
|
223
|
-
directories to search for static files. This can be done by using the <a
|
224
|
-
href="../classes/MultiDirHandler.html">MultiDirHandler</a> (see
|
225
|
-
rev-config.rb)
|
226
|
-
</p>
|
227
|
-
<h2>Supported Features of <a href="../classes/ESI.html">ESI</a></h2>
|
228
|
-
<p>
|
229
|
-
From [<a href="http://www.w3.org/TR/esi-lang">www.w3.org/TR/esi-lang</a>
|
230
|
-
esi-lang]
|
231
|
-
</p>
|
232
|
-
<p>
|
233
|
-
MongrelESI supports basic include, exception handling and invalidation. It
|
234
|
-
does not include support for Variable or Conditional processing. It does
|
235
|
-
have suppport for COOKIE variables. (e.g. $(HTTP_COOKIE{name}) will be
|
236
|
-
replaced with the value of the cookie, name)
|
237
|
-
</p>
|
238
|
-
<p>
|
239
|
-
+ Inclusion - <a href="../classes/ESI.html">ESI</a> can compose pages by
|
240
|
-
assembling included content, which is fetched from the network.
|
241
|
-
</p>
|
242
|
-
<pre>
|
243
|
-
This allows each such fragment to have its own metadata (e.g., cacheability and handling information) seperately associated.
|
244
|
-
</pre>
|
245
|
-
<ul>
|
246
|
-
<li>Variable support - <a href="../classes/ESI.html">ESI</a> 1.0 supports the
|
247
|
-
use of variables based on HTTP request attributes in a manner
|
248
|
-
|
249
|
-
<pre>
|
250
|
-
reminiscent of the Common Gateway Interface. These variables can be used by ESI statements or written directly into the processed markup.
|
251
|
-
</pre>
|
252
|
-
</li>
|
253
|
-
<li>Conditional processing - <a href="../classes/ESI.html">ESI</a> allows
|
254
|
-
conditional logic with Boolean comparisons to be used to influence how a
|
255
|
-
template is processed.
|
256
|
-
|
257
|
-
</li>
|
258
|
-
</ul>
|
259
|
-
<p>
|
260
|
-
+ Exception and error handling - <a href="../classes/ESI.html">ESI</a>
|
261
|
-
provides for specification of alternate and default resources in a number
|
262
|
-
of situations.
|
263
|
-
</p>
|
264
|
-
<h2>HTTP Readings</h2>
|
265
|
-
<ul>
|
266
|
-
<li><a
|
267
|
-
href="http://www.jmarshall.com/easy/http">www.jmarshall.com/easy/http</a>/
|
268
|
-
|
269
|
-
</li>
|
270
|
-
</ul>
|
271
|
-
<h2>Adding New Features and Bug Fixing</h2>
|
272
|
-
<p>
|
273
|
-
Before adding a new feature or bug fix, it‘s important to add a test
|
274
|
-
to verify the behavior.
|
275
|
-
</p>
|
276
|
-
<p>
|
277
|
-
Also, help out by keeping the Changelog updated with new features and major
|
278
|
-
bug fixes
|
279
|
-
</p>
|
280
|
-
<h2>Future ideas of improving integration</h2>
|
281
|
-
<p>
|
282
|
-
NOTE: this is a work in progress, below is how I‘d like to integrate
|
283
|
-
with rails in the future
|
284
|
-
</p>
|
285
|
-
<p>
|
286
|
-
cd to/path/to/your/primary/rails/app
|
287
|
-
</p>
|
288
|
-
<p>
|
289
|
-
mongrel_esi add . —default mongrel_esi add
|
290
|
-
path/to/your/rails/secondary_app2 mongrel_esi add
|
291
|
-
path/to/your/rails/secondary_app3 mongrel_esi add
|
292
|
-
path/to/your/rails/secondary_app4
|
293
|
-
</p>
|
294
|
-
<p>
|
295
|
-
mongrel_esi start
|
296
|
-
</p>
|
297
|
-
<pre>
|
298
|
-
- starts up mongrel in each of the applications
|
299
|
-
</pre>
|
300
|
-
<h2>Credits ==</h2>
|
301
|
-
<p>
|
302
|
-
Support:
|
303
|
-
</p>
|
304
|
-
<pre>
|
305
|
-
Zed A. Shaw -- For writing [http://mongrel.rubyforge.org/ mongrel]
|
306
|
-
Adrian D. Thurston -- For writing [http://www.cs.queensu.ca/~thurston/ragel/ ragel]
|
307
|
-
|
308
|
-
The [http://www.ruby-lang.org/ ruby] community, for all their insights and help
|
309
|
-
</pre>
|
310
|
-
<p>
|
311
|
-
Author:
|
312
|
-
</p>
|
313
|
-
<pre>
|
314
|
-
Todd Fisher
|
315
|
-
</pre>
|
316
|
-
<p>
|
317
|
-
Co-Authors:
|
318
|
-
</p>
|
319
|
-
<pre>
|
320
|
-
Aaron Batalion -- Design ideas and integrating with Rails, fragment_fu. Ragel advocate
|
321
|
-
Richard Kilmer -- Thread saftey dispatcher, production ready
|
322
|
-
Adam Bair -- Writing the initial testing framework and logger.
|
323
|
-
Jeff Damick -- Writing the initial configuration.
|
324
|
-
</pre>
|
325
|
-
<p>
|
326
|
-
And of course thanks to everyone in ruby-lang for putting up with my
|
327
|
-
questions MenTaLguY for the great help in making good use of ruby
|
328
|
-
</p>
|
329
|
-
|
330
|
-
</div>
|
331
|
-
|
332
|
-
|
333
|
-
</div>
|
334
|
-
|
335
|
-
|
336
|
-
</div>
|
337
|
-
|
338
|
-
|
339
|
-
<!-- if includes -->
|
340
|
-
|
341
|
-
<div id="section">
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
<!-- if method_list -->
|
351
|
-
|
352
|
-
|
353
|
-
</div>
|
354
|
-
|
355
|
-
|
356
|
-
<div id="validator-badges">
|
357
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
358
|
-
</div>
|
359
|
-
|
360
|
-
</body>
|
361
|
-
</html>
|
@@ -1,113 +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>File: cache.rb</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="fileHeader">
|
50
|
-
<h1>cache.rb</h1>
|
51
|
-
<table class="header-table">
|
52
|
-
<tr class="top-aligned-row">
|
53
|
-
<td><strong>Path:</strong></td>
|
54
|
-
<td>lib/esi/cache.rb
|
55
|
-
</td>
|
56
|
-
</tr>
|
57
|
-
<tr class="top-aligned-row">
|
58
|
-
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>Sat Jan 05 23:36:52 -0500 2008</td>
|
60
|
-
</tr>
|
61
|
-
</table>
|
62
|
-
</div>
|
63
|
-
<!-- banner header -->
|
64
|
-
|
65
|
-
<div id="bodyContent">
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<div id="contextContent">
|
70
|
-
|
71
|
-
|
72
|
-
<div id="requires-list">
|
73
|
-
<h3 class="section-bar">Required files</h3>
|
74
|
-
|
75
|
-
<div class="name-list">
|
76
|
-
digest/sha1
|
77
|
-
thread
|
78
|
-
ostruct
|
79
|
-
esi/logger
|
80
|
-
rubygems
|
81
|
-
memcache
|
82
|
-
</div>
|
83
|
-
</div>
|
84
|
-
|
85
|
-
</div>
|
86
|
-
|
87
|
-
|
88
|
-
</div>
|
89
|
-
|
90
|
-
|
91
|
-
<!-- if includes -->
|
92
|
-
|
93
|
-
<div id="section">
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
<!-- if method_list -->
|
103
|
-
|
104
|
-
|
105
|
-
</div>
|
106
|
-
|
107
|
-
|
108
|
-
<div id="validator-badges">
|
109
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
110
|
-
</div>
|
111
|
-
|
112
|
-
</body>
|
113
|
-
</html>
|