merb-cache 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/LICENSE +2 -2
  2. data/README +207 -143
  3. data/Rakefile +55 -10
  4. data/TODO +0 -2
  5. data/lib/merb-cache/cache.rb +84 -0
  6. data/lib/merb-cache/core_ext/enumerable.rb +9 -0
  7. data/lib/merb-cache/core_ext/hash.rb +20 -0
  8. data/lib/merb-cache/merb_ext/controller.rb +167 -0
  9. data/lib/merb-cache/stores/fundamental/abstract_store.rb +101 -0
  10. data/lib/merb-cache/stores/fundamental/file_store.rb +112 -0
  11. data/lib/merb-cache/stores/fundamental/memcached_store.rb +112 -0
  12. data/lib/merb-cache/stores/strategy/abstract_strategy_store.rb +123 -0
  13. data/lib/merb-cache/stores/strategy/action_store.rb +56 -0
  14. data/lib/merb-cache/stores/strategy/adhoc_store.rb +69 -0
  15. data/lib/merb-cache/stores/strategy/gzip_store.rb +63 -0
  16. data/lib/merb-cache/stores/strategy/page_store.rb +64 -0
  17. data/lib/merb-cache/stores/strategy/sha1_store.rb +62 -0
  18. data/lib/merb-cache.rb +8 -7
  19. data/spec/merb-cache/cache_spec.rb +88 -0
  20. data/spec/merb-cache/core_ext/enumerable_spec.rb +22 -0
  21. data/spec/merb-cache/core_ext/hash_spec.rb +20 -0
  22. data/spec/merb-cache/merb_ext/controller_spec.rb +284 -0
  23. data/spec/merb-cache/stores/fundamental/abstract_store_spec.rb +166 -0
  24. data/spec/merb-cache/stores/fundamental/file_store_spec.rb +186 -0
  25. data/spec/merb-cache/stores/fundamental/memcached_store_spec.rb +243 -0
  26. data/spec/merb-cache/stores/strategy/abstract_strategy_store_spec.rb +78 -0
  27. data/spec/merb-cache/stores/strategy/action_store_spec.rb +189 -0
  28. data/spec/merb-cache/stores/strategy/adhoc_store_spec.rb +225 -0
  29. data/spec/merb-cache/stores/strategy/gzip_store_spec.rb +51 -0
  30. data/spec/merb-cache/stores/strategy/page_store_spec.rb +111 -0
  31. data/spec/merb-cache/stores/strategy/sha1_store_spec.rb +75 -0
  32. data/spec/spec_helper.rb +69 -72
  33. metadata +42 -31
  34. data/lib/merb-cache/cache-action.rb +0 -144
  35. data/lib/merb-cache/cache-fragment.rb +0 -95
  36. data/lib/merb-cache/cache-page.rb +0 -203
  37. data/lib/merb-cache/cache-store/database-activerecord.rb +0 -88
  38. data/lib/merb-cache/cache-store/database-datamapper.rb +0 -79
  39. data/lib/merb-cache/cache-store/database-sequel.rb +0 -78
  40. data/lib/merb-cache/cache-store/database.rb +0 -144
  41. data/lib/merb-cache/cache-store/dummy.rb +0 -106
  42. data/lib/merb-cache/cache-store/file.rb +0 -194
  43. data/lib/merb-cache/cache-store/memcache.rb +0 -199
  44. data/lib/merb-cache/cache-store/memory.rb +0 -168
  45. data/lib/merb-cache/merb-cache.rb +0 -165
  46. data/lib/merb-cache/merbtasks.rb +0 -6
  47. data/spec/config/database.yml +0 -14
  48. data/spec/controller.rb +0 -101
  49. data/spec/log/merb_test.log +0 -433
  50. data/spec/merb-cache-action_spec.rb +0 -162
  51. data/spec/merb-cache-fragment_spec.rb +0 -100
  52. data/spec/merb-cache-page_spec.rb +0 -150
  53. data/spec/merb-cache_spec.rb +0 -15
  54. data/spec/views/cache_controller/action1.html.erb +0 -4
  55. data/spec/views/cache_controller/action2.html.haml +0 -4
@@ -1,433 +0,0 @@
1
- Mon, 21 Jul 2008 23:29:20 GMT ~ info ~ Logfile created
2
- ~ Using memcache cache
3
- ~ Not Using Sessions
4
- ~ Using memory cache
5
- ~ Not Using Sessions
6
- ~ cache: expired all
7
- ~ {:after_filters_time=>2.0e-05, :before_filters_time=>4.0e-05, :action_time=>0.000221}
8
- ~ {:after_filters_time=>4.0e-05, :before_filters_time=>2.5e-05, :action_time=>0.000792}
9
- ~ cache: hit (key1)
10
- ~ {:after_filters_time=>2.2e-05, :before_filters_time=>2.5e-05, :action_time=>0.000636}
11
- ~ cache: hit (key11)
12
- ~ {:after_filters_time=>4.5e-05, :before_filters_time=>9.4e-05, :action_time=>0.001524}
13
- ~ cache: hit (key11)
14
- ~ cache: expired (key11)
15
- ~ cache: miss (key11)
16
- ~ {:after_filters_time=>3.8e-05, :before_filters_time=>8.8e-05, :action_time=>0.001444}
17
- ~ cache: expired (key1)
18
- ~ cache: miss (key1)
19
- ~ {:after_filters_time=>3.1e-05, :before_filters_time=>4.0e-05, :action_time=>0.00092}
20
- ~ cache: miss (unknown_key)
21
- ~ cache: set (test1)
22
- ~ cache: hit (test1)
23
- ~ cache: set (test2)
24
- ~ cache: hit (test2)
25
- ~ cache: set (test3)
26
- ~ cache: hit (test3)
27
- ~ cache: expired matching (test)
28
- ~ cache: miss (test1)
29
- ~ cache: miss (test2)
30
- ~ cache: miss (test3)
31
- ~ cache: set (timed_key)
32
- ~ cache: hit (timed_key)
33
- ~ cache: miss (timed_key)
34
- ~ cache: set (test1)
35
- ~ cache: expired (test1)
36
- ~ cache: miss (test1)
37
- ~ cache: set (test2/id1)
38
- ~ cache: expired (test2/id1)
39
- ~ cache: miss (test2/id1)
40
- ~ cache: set (test3)
41
- ~ cache: expired (test3)
42
- ~ cache: miss (test3)
43
- ~ cache: set (test4/id1)
44
- ~ cache: expired matching (test4/id1)
45
- ~ cache: miss (test4/id1/id2)
46
- ~ cache: expired all
47
- ~ cache: miss (key1)
48
- ~ cache: set (key1)
49
- ~ cache: hit (key1)
50
- ~ cache: miss (/cache_controller/action3)
51
- ~ cache: set (/cache_controller/action3)
52
- ~ {:after_filters_time=>7.9e-05, :before_filters_time=>0.000111, :action_time=>0.000218}
53
- ~ cache: hit (/cache_controller/action3)
54
- ~ cache: expired (/cache_controller/action3)
55
- ~ cache: miss (/cache_controller/action3)
56
- ~ cache: miss (/cache_controller/action3/abc/456/ghi)
57
- ~ cache: set (/cache_controller/action3/abc/456/ghi)
58
- ~ {:after_filters_time=>6.9e-05, :before_filters_time=>7.9e-05, :action_time=>0.000163}
59
- ~ cache: hit (/cache_controller/action3/abc/456/ghi)
60
- ~ cache: hit (/cache_controller/action3/abc/456/ghi)
61
- ~ {:after_filters_time=>3.4e-05, :action_time=>0.00011}
62
- ~ cache: expired (/cache_controller/action3/abc/456/ghi)
63
- ~ cache: miss (/cache_controller/action3/abc/456/ghi)
64
- ~ cache: miss (/cache_controller/action4)
65
- ~ cache: set (/cache_controller/action4)
66
- ~ {:after_filters_time=>7.6e-05, :before_filters_time=>7.9e-05, :action_time=>0.00017}
67
- ~ cache: hit (/cache_controller/action4)
68
- ~ cache: miss (/cache_controller/action4)
69
- ~ cache: expired matching (/cache_controller/action4)
70
- ~ cache: miss (/cache_controller/action4/path/to/nowhere)
71
- ~ cache: set (/cache_controller/action4/path/to/nowhere)
72
- ~ {:after_filters_time=>9.5e-05, :before_filters_time=>0.000108, :action_time=>0.000227}
73
- ~ cache: miss (/cache_controller/action4/path/to/nowhere)
74
- ~ cache: miss (/cache_controller/action4)
75
- ~ cache: set (/cache_controller/action4)
76
- ~ {:after_filters_time=>9.2e-05, :before_filters_time=>0.000112, :action_time=>0.000225}
77
- ~ cache: expired (/cache_controller/action4)
78
- ~ cache: miss (/cache_controller/action4)
79
- ~ cache: set (/cache_controller/action4)
80
- ~ {:after_filters_time=>8.1e-05, :before_filters_time=>8.8e-05, :action_time=>0.000184}
81
- ~ cache: expired matching (/cache_control)
82
- ~ cache: miss (/cache_controller/action4)
83
- ~ cache: set (/cache_controller/action4)
84
- ~ {:after_filters_time=>7.2e-05, :before_filters_time=>7.8e-05, :action_time=>0.000164}
85
- ~ cache: expired (/cache_controller/action4)
86
- ~ cache: miss (/cache_controller/action4/id1/id2)
87
- ~ cache: set (/cache_controller/action4/id1/id2)
88
- ~ {:after_filters_time=>7.3e-05, :before_filters_time=>7.8e-05, :action_time=>0.000164}
89
- ~ cache: expired (/cache_controller/action4/id1/id2)
90
- ~ cache: miss (/cache_controller/action4/id1/id2)
91
- ~ cache: set (/cache_controller/action4/id1/id2)
92
- ~ {:after_filters_time=>7.2e-05, :before_filters_time=>7.8e-05, :action_time=>0.000164}
93
- ~ cache: expired matching (/cache_controller/action4)
94
- ~ cache: miss (/cache_controller/action4)
95
- ~ cache: set (/cache_controller/action4)
96
- ~ {:after_filters_time=>7.3e-05, :before_filters_time=>7.7e-05, :action_time=>0.000164}
97
- ~ cache: expired (/cache_controller/action4)
98
- ~ cache: miss (/cache_controller/action4/id1/id2)
99
- ~ cache: set (/cache_controller/action4/id1/id2)
100
- ~ {:after_filters_time=>7.2e-05, :before_filters_time=>7.7e-05, :action_time=>0.000163}
101
- ~ cache: expired matching (/cache_controller/action4/id1)
102
- ~ cache: miss (/cache_controller/action4/id1/id2)
103
- ~ cache: set (/cache_controller/action4/id1/id2)
104
- ~ {:after_filters_time=>7.3e-05, :before_filters_time=>9.1e-05, :action_time=>0.000178}
105
- ~ cache: expired matching (/cache_controller/action4)
106
- ~ cache: miss (/cache_controller/action4/id1/id2)
107
- ~ cache: set (/cache_controller/action4/id1/id2)
108
- ~ {:after_filters_time=>7.1e-05, :before_filters_time=>7.7e-05, :action_time=>0.000164}
109
- ~ cache: expired matching (/cache_controller/action4/id1)
110
- ~ cache: miss (/cache_controller/action4/id1/id2)
111
- ~ cache: set (/cache_controller/action4/id1/id2)
112
- ~ {:after_filters_time=>7.3e-05, :before_filters_time=>9.1e-05, :action_time=>0.000178}
113
- ~ cache: expired (/cache_controller/action4/id1/id2)
114
- ~ cache: miss (/cache_controller/action4)
115
- ~ cache: set (/cache_controller/action4)
116
- ~ {:after_filters_time=>7.2e-05, :before_filters_time=>9.1e-05, :action_time=>0.000177}
117
- ~ cache: expired (/cache_controller/action4)
118
- ~ cache: miss (/cache_controller/action4/id1/id2)
119
- ~ cache: set (/cache_controller/action4/id1/id2)
120
- ~ {:after_filters_time=>6.5e-05, :before_filters_time=>8.3e-05, :action_time=>0.000161}
121
- ~ cache: expired (/cache_controller/action4/id1/id2)
122
- ~ cache: miss (/cache_controller/action4/id1/id2)
123
- ~ cache: set (/cache_controller/action4/id1/id2)
124
- ~ {:after_filters_time=>6.5e-05, :before_filters_time=>8.2e-05, :action_time=>0.00016}
125
- ~ cache: expired matching (/cache_controller/action4/id1)
126
- ~ cache: miss (/cache_controller/action4/id1/id2)
127
- ~ cache: set (/cache_controller/action4/id1/id2)
128
- ~ {:after_filters_time=>5.0e-05, :before_filters_time=>5.8e-05, :action_time=>0.000119}
129
- ~ cache: expired matching (/cache_controller/action4/id1)
130
- ~ {:after_filters_time=>2.6e-05, :before_filters_time=>0.000175, :action_time=>0.000213}
131
- ~ cache: miss (/cache_controller/action8/cache)
132
- ~ cache: set (/cache_controller/action8/cache)
133
- ~ {:after_filters_time=>5.5e-05, :before_filters_time=>0.000142, :action_time=>0.000208}
134
- ~ {:after_filters_time=>2.6e-05, :before_filters_time=>0.000104, :action_time=>0.000141}
135
- ~ cache: miss (/cache_controller/action9/cache)
136
- ~ cache: set (/cache_controller/action9/cache)
137
- ~ {:after_filters_time=>5.6e-05, :before_filters_time=>0.000129, :action_time=>0.000194}
138
- ~ {:after_filters_time=>2.4e-05, :before_filters_time=>0.000106, :action_time=>0.000139}
139
- ~ cache: miss (/cache_controller/action10/cache)
140
- ~ cache: set (/cache_controller/action10/cache)
141
- ~ {:after_filters_time=>5.2e-05, :before_filters_time=>0.000126, :action_time=>0.000187}
142
- ~ {:after_filters_time=>2.4e-05, :before_filters_time=>0.000103, :action_time=>0.000136}
143
- ~ cache: miss (/cache_controller/action11/cache)
144
- ~ cache: set (/cache_controller/action11/cache)
145
- ~ {:after_filters_time=>5.1e-05, :before_filters_time=>0.000134, :action_time=>0.000195}
146
- ~ cache: set (/cache_controller/action5)
147
- ~ {:after_filters_time=>0.000414, :before_filters_time=>0.000163, :action_time=>0.000596}
148
- ~ cache: set (/cache_controller/action5/this/is/a/test)
149
- ~ {:after_filters_time=>0.001305, :before_filters_time=>0.000296, :action_time=>0.001627}
150
- ~ cache: set (/cache_controller/action6)
151
- ~ {:after_filters_time=>0.000582, :before_filters_time=>0.000236, :action_time=>0.000858}
152
- ~ cache: hit (/cache_controller/action6)
153
- ~ {:after_filters_time=>2.4e-05, :action_time=>0.000346}
154
- ~ cache: set (/cache_controller/action6)
155
- ~ {:after_filters_time=>0.000622, :before_filters_time=>0.0008, :action_time=>0.001475}
156
- ~ cache: set (/cache_controller/action6/path/to/nowhere)
157
- ~ {:after_filters_time=>0.001422, :before_filters_time=>0.000258, :action_time=>0.001737}
158
- ~ cache: hit (/cache_controller/action6/path/to/nowhere)
159
- ~ {:after_filters_time=>3.8e-05, :action_time=>0.000656}
160
- ~ cache: set (/cache_controller/action6/path/to/nowhere)
161
- ~ {:after_filters_time=>0.000387, :before_filters_time=>0.000445, :action_time=>0.000869}
162
- ~ cache: set (/cache_controller/action6)
163
- ~ {:after_filters_time=>0.000341, :before_filters_time=>0.000178, :action_time=>0.000543}
164
- ~ cache: set (/cache_controller/action6)
165
- ~ {:after_filters_time=>0.000574, :before_filters_time=>0.000164, :action_time=>0.000771}
166
- ~ cache: set (/cache_controller/action6)
167
- ~ {:after_filters_time=>0.000375, :before_filters_time=>0.000167, :action_time=>0.000575}
168
- ~ cache: set (/cache_controller/action6/id1/id2)
169
- ~ {:after_filters_time=>0.00086, :before_filters_time=>0.000183, :action_time=>0.001069}
170
- ~ cache: set (/cache_controller/action6/id1/id2)
171
- ~ {:after_filters_time=>0.000349, :before_filters_time=>0.00016, :action_time=>0.000536}
172
- ~ cache: set (/cache_controller/action6)
173
- ~ {:after_filters_time=>0.000367, :before_filters_time=>0.000149, :action_time=>0.000543}
174
- ~ cache: set (/cache_controller/action6/id1/id2)
175
- ~ {:after_filters_time=>0.000718, :before_filters_time=>0.000163, :action_time=>0.000908}
176
- ~ cache: set (/cache_controller/action6/id1/id2)
177
- ~ {:after_filters_time=>0.000332, :before_filters_time=>0.000141, :action_time=>0.000502}
178
- ~ cache: set (/cache_controller/action6/id1/id2)
179
- ~ {:after_filters_time=>0.000696, :before_filters_time=>0.000155, :action_time=>0.000877}
180
- ~ cache: set (/cache_controller/action6/id1/id2)
181
- ~ {:after_filters_time=>0.000397, :before_filters_time=>0.000154, :action_time=>0.000578}
182
- ~ cache: set (/cache_controller/action6)
183
- ~ {:after_filters_time=>0.000371, :before_filters_time=>0.00018, :action_time=>0.000577}
184
- ~ cache: set (/cache_controller/action6/id1/id2)
185
- ~ {:after_filters_time=>0.000358, :before_filters_time=>0.000172, :action_time=>0.000555}
186
- ~ cache: set (/cache_controller/action6/id1/id2)
187
- ~ {:after_filters_time=>0.000353, :before_filters_time=>0.000156, :action_time=>0.000544}
188
- ~ cache: set (/cache_controller/action6/id1/id2)
189
- ~ {:after_filters_time=>0.000337, :before_filters_time=>0.000151, :action_time=>0.000515}
190
- ~ cache: set (/cache_controller/action7.css)
191
- ~ {:after_filters_time=>0.000535, :before_filters_time=>0.000459, :action_time=>0.001035}
192
- ~ cache: hit (/cache_controller/action7.css)
193
- ~ {:after_filters_time=>2.7e-05, :action_time=>0.000552}
194
- ~ cache: set (/cache_controller/action7.js)
195
- ~ {:after_filters_time=>0.000539, :before_filters_time=>0.000381, :action_time=>0.000956}
196
- ~ cache: hit (/cache_controller/action7.js)
197
- ~ {:after_filters_time=>2.2e-05, :action_time=>0.0003}
198
- ~ cache: set (/cache_controller/action7.xml)
199
- ~ {:after_filters_time=>0.000405, :before_filters_time=>0.000169, :action_time=>0.000599}
200
- ~ cache: hit (/cache_controller/action7.xml)
201
- ~ {:after_filters_time=>2.1e-05, :action_time=>0.000263}
202
- ~ cache: set (/cache_controller/action7.jpg)
203
- ~ {:after_filters_time=>0.000331, :before_filters_time=>0.000173, :action_time=>0.000528}
204
- ~ cache: hit (/cache_controller/action7.jpg)
205
- ~ {:after_filters_time=>1.9e-05, :action_time=>0.000259}
206
- ~ cache: set (/cache_controller/action7.html)
207
- ~ {:after_filters_time=>0.000308, :before_filters_time=>0.00017, :action_time=>0.0005}
208
- ~ cache: hit (/cache_controller/action7.html)
209
- ~ {:after_filters_time=>2.2e-05, :action_time=>0.000288}
210
- ~ Using memcache cache
211
- ~ Not Using Sessions
212
- ~ cache: expired all
213
- ~ {:after_filters_time=>1.9e-05, :before_filters_time=>4.1e-05, :action_time=>0.000244}
214
- ~ cache: miss (key1)
215
- ~ cache: set (key1)
216
- ~ {:after_filters_time=>2.8e-05, :before_filters_time=>2.4e-05, :action_time=>0.00422}
217
- ~ cache: miss (key11)
218
- ~ cache: set (key11)
219
- ~ {:after_filters_time=>2.4e-05, :before_filters_time=>3.4e-05, :action_time=>0.001341}
220
- ~ {:after_filters_time=>2.7e-05, :before_filters_time=>4.9e-05, :action_time=>0.001105}
221
- ~ cache: expired (key11)
222
- ~ cache: miss (key11)
223
- ~ {:after_filters_time=>3.9e-05, :before_filters_time=>9.3e-05, :action_time=>0.001921}
224
- ~ cache: expired (key1)
225
- ~ cache: miss (key1)
226
- ~ cache: miss (key1)
227
- ~ cache: set (key1)
228
- ~ {:after_filters_time=>3.1e-05, :before_filters_time=>4.2e-05, :action_time=>0.001765}
229
- ~ cache: miss (unknown_key)
230
- ~ cache: set (test1)
231
- ~ cache: set (test2)
232
- ~ cache: set (test3)
233
- ~ cache: expired (test1)
234
- ~ cache: expired (test2)
235
- ~ cache: expired (test3)
236
- ~ cache: miss (test1)
237
- ~ cache: miss (test2)
238
- ~ cache: miss (test3)
239
- ~ cache: set (timed_key)
240
- ~ cache: miss (timed_key)
241
- ~ cache: set (test1)
242
- ~ cache: expired (test1)
243
- ~ cache: miss (test1)
244
- ~ cache: set (test2/id1)
245
- ~ cache: expired (test2/id1)
246
- ~ cache: miss (test2/id1)
247
- ~ cache: set (test3)
248
- ~ cache: expired (test3)
249
- ~ cache: miss (test3)
250
- ~ cache: set (test4/id1)
251
- ~ cache: expired (test4/id1)
252
- ~ cache: miss (test4/id1/id2)
253
- ~ cache: expired all
254
- ~ cache: miss (key1)
255
- ~ cache: set (key1)
256
- ~ cache: miss (/cache_controller/action3)
257
- ~ cache: set (/cache_controller/action3)
258
- ~ {:after_filters_time=>0.000491, :before_filters_time=>0.000238, :action_time=>0.000753}
259
- ~ cache: expired (/cache_controller/action3)
260
- ~ cache: miss (/cache_controller/action3)
261
- ~ cache: miss (/cache_controller/action3/abc/456/ghi)
262
- ~ cache: set (/cache_controller/action3/abc/456/ghi)
263
- ~ {:after_filters_time=>0.000458, :before_filters_time=>0.000186, :action_time=>0.000689}
264
- ~ {:after_filters_time=>2.3e-05, :action_time=>0.000186}
265
- ~ cache: expired (/cache_controller/action3/abc/456/ghi)
266
- ~ cache: miss (/cache_controller/action3/abc/456/ghi)
267
- ~ cache: miss (/cache_controller/action4)
268
- ~ cache: set (/cache_controller/action4)
269
- ~ {:after_filters_time=>0.000462, :before_filters_time=>0.000182, :action_time=>0.000656}
270
- ~ cache: miss (/cache_controller/action4)
271
- ~ cache: miss (/cache_controller/action4)
272
- ~ cache: expired (/cache_controller/action4)
273
- ~ cache: miss (/cache_controller/action4/path/to/nowhere)
274
- ~ cache: miss (/cache_controller/action4/path/to/nowhere)
275
- ~ cache: set (/cache_controller/action4/path/to/nowhere)
276
- ~ {:after_filters_time=>0.000713, :before_filters_time=>0.000315, :action_time=>0.00105}
277
- ~ cache: miss (/cache_controller/action4/path/to/nowhere)
278
- ~ cache: miss (/cache_controller/action4/path/to/nowhere)
279
- ~ cache: miss (/cache_controller/action4)
280
- ~ cache: set (/cache_controller/action4)
281
- ~ {:after_filters_time=>0.002476, :before_filters_time=>0.000364, :action_time=>0.002862}
282
- ~ cache: expired (/cache_controller/action4)
283
- ~ cache: miss (/cache_controller/action4)
284
- ~ cache: miss (/cache_controller/action4)
285
- ~ cache: set (/cache_controller/action4)
286
- ~ {:after_filters_time=>0.000716, :before_filters_time=>0.000307, :action_time=>0.00104}
287
- ~ cache: expired (/cache_controller/action4/path/to/nowhere)
288
- ~ cache: expired (/cache_controller/action4)
289
- ~ cache: miss (/cache_controller/action4)
290
- ~ cache: miss (/cache_controller/action4)
291
- ~ cache: set (/cache_controller/action4)
292
- ~ {:after_filters_time=>0.000476, :before_filters_time=>0.000189, :action_time=>0.000675}
293
- ~ cache: expired (/cache_controller/action4)
294
- ~ cache: miss (/cache_controller/action4)
295
- ~ cache: miss (/cache_controller/action4/id1/id2)
296
- ~ cache: set (/cache_controller/action4/id1/id2)
297
- ~ {:after_filters_time=>0.000473, :before_filters_time=>0.000189, :action_time=>0.000671}
298
- ~ cache: expired (/cache_controller/action4/id1/id2)
299
- ~ cache: miss (/cache_controller/action4/id1/id2)
300
- ~ cache: miss (/cache_controller/action4/id1/id2)
301
- ~ cache: set (/cache_controller/action4/id1/id2)
302
- ~ {:after_filters_time=>0.000486, :before_filters_time=>0.000181, :action_time=>0.000678}
303
- ~ cache: expired (/cache_controller/action4/id1/id2)
304
- ~ cache: miss (/cache_controller/action4/id1/id2)
305
- ~ cache: miss (/cache_controller/action4)
306
- ~ cache: set (/cache_controller/action4)
307
- ~ {:after_filters_time=>0.000484, :before_filters_time=>0.00019, :action_time=>0.000683}
308
- ~ cache: expired (/cache_controller/action4)
309
- ~ cache: miss (/cache_controller/action4)
310
- ~ cache: miss (/cache_controller/action4/id1/id2)
311
- ~ cache: set (/cache_controller/action4/id1/id2)
312
- ~ {:after_filters_time=>0.000487, :before_filters_time=>0.000182, :action_time=>0.000679}
313
- ~ cache: expired (/cache_controller/action4/id1/id2)
314
- ~ cache: miss (/cache_controller/action4/id1/id2)
315
- ~ cache: miss (/cache_controller/action4/id1/id2)
316
- ~ cache: set (/cache_controller/action4/id1/id2)
317
- ~ {:after_filters_time=>0.000471, :before_filters_time=>0.000187, :action_time=>0.000668}
318
- ~ cache: expired (/cache_controller/action4/id1/id2)
319
- ~ cache: miss (/cache_controller/action4/id1/id2)
320
- ~ cache: miss (/cache_controller/action4/id1/id2)
321
- ~ cache: set (/cache_controller/action4/id1/id2)
322
- ~ {:after_filters_time=>0.000475, :before_filters_time=>0.000195, :action_time=>0.00068}
323
- ~ cache: expired (/cache_controller/action4/id1/id2)
324
- ~ cache: miss (/cache_controller/action4/id1/id2)
325
- ~ cache: miss (/cache_controller/action4/id1/id2)
326
- ~ cache: set (/cache_controller/action4/id1/id2)
327
- ~ {:after_filters_time=>0.000489, :before_filters_time=>0.000174, :action_time=>0.000671}
328
- ~ cache: expired (/cache_controller/action4/id1/id2)
329
- ~ cache: miss (/cache_controller/action4/id1/id2)
330
- ~ cache: miss (/cache_controller/action4)
331
- ~ cache: set (/cache_controller/action4)
332
- ~ {:after_filters_time=>0.000485, :before_filters_time=>0.000199, :action_time=>0.000694}
333
- ~ cache: expired (/cache_controller/action4)
334
- ~ cache: miss (/cache_controller/action4)
335
- ~ cache: miss (/cache_controller/action4/id1/id2)
336
- ~ cache: set (/cache_controller/action4/id1/id2)
337
- ~ {:after_filters_time=>0.000474, :before_filters_time=>0.000189, :action_time=>0.000673}
338
- ~ cache: expired (/cache_controller/action4/id1/id2)
339
- ~ cache: miss (/cache_controller/action4/id1/id2)
340
- ~ cache: miss (/cache_controller/action4/id1/id2)
341
- ~ cache: set (/cache_controller/action4/id1/id2)
342
- ~ {:after_filters_time=>0.000471, :before_filters_time=>0.000186, :action_time=>0.000667}
343
- ~ cache: expired (/cache_controller/action4/id1/id2)
344
- ~ cache: miss (/cache_controller/action4/id1/id2)
345
- ~ cache: miss (/cache_controller/action4/id1/id2)
346
- ~ cache: set (/cache_controller/action4/id1/id2)
347
- ~ {:after_filters_time=>0.000486, :before_filters_time=>0.00019, :action_time=>0.000686}
348
- ~ cache: expired (/cache_controller/action4/id1/id2)
349
- ~ cache: miss (/cache_controller/action4/id1/id2)
350
- ~ {:after_filters_time=>2.6e-05, :before_filters_time=>0.000162, :action_time=>0.000202}
351
- ~ cache: miss (/cache_controller/action8)
352
- ~ cache: miss (/cache_controller/action8/cache)
353
- ~ cache: set (/cache_controller/action8/cache)
354
- ~ {:after_filters_time=>0.000484, :before_filters_time=>0.000266, :action_time=>0.000759}
355
- ~ {:after_filters_time=>2.6e-05, :before_filters_time=>0.000107, :action_time=>0.000143}
356
- ~ cache: miss (/cache_controller/action9)
357
- ~ cache: miss (/cache_controller/action9/cache)
358
- ~ cache: set (/cache_controller/action9/cache)
359
- ~ {:after_filters_time=>0.000502, :before_filters_time=>0.000276, :action_time=>0.000788}
360
- ~ {:after_filters_time=>2.5e-05, :before_filters_time=>0.000147, :action_time=>0.000182}
361
- ~ cache: miss (/cache_controller/action10)
362
- ~ cache: miss (/cache_controller/action10/cache)
363
- ~ cache: set (/cache_controller/action10/cache)
364
- ~ {:after_filters_time=>0.003832, :before_filters_time=>0.000274, :action_time=>0.004122}
365
- ~ {:after_filters_time=>3.2e-05, :before_filters_time=>0.000154, :action_time=>0.000203}
366
- ~ cache: miss (/cache_controller/action11)
367
- ~ cache: miss (/cache_controller/action11/cache)
368
- ~ cache: set (/cache_controller/action11/cache)
369
- ~ {:after_filters_time=>0.000503, :before_filters_time=>0.000397, :action_time=>0.000915}
370
- ~ cache: set (/cache_controller/action5)
371
- ~ {:after_filters_time=>0.000436, :before_filters_time=>0.000189, :action_time=>0.000647}
372
- ~ cache: set (/cache_controller/action5/this/is/a/test)
373
- ~ {:after_filters_time=>0.001277, :before_filters_time=>0.000256, :action_time=>0.001557}
374
- ~ cache: set (/cache_controller/action6)
375
- ~ {:after_filters_time=>0.000479, :before_filters_time=>0.000253, :action_time=>0.00077}
376
- ~ cache: hit (/cache_controller/action6)
377
- ~ {:after_filters_time=>3.8e-05, :action_time=>0.000645}
378
- ~ cache: set (/cache_controller/action6)
379
- ~ {:after_filters_time=>0.00062, :before_filters_time=>0.000919, :action_time=>0.001593}
380
- ~ cache: set (/cache_controller/action6/path/to/nowhere)
381
- ~ {:after_filters_time=>0.001441, :before_filters_time=>0.000285, :action_time=>0.001775}
382
- ~ cache: hit (/cache_controller/action6/path/to/nowhere)
383
- ~ {:after_filters_time=>3.8e-05, :action_time=>0.000643}
384
- ~ cache: set (/cache_controller/action6/path/to/nowhere)
385
- ~ {:after_filters_time=>0.000637, :before_filters_time=>0.000806, :action_time=>0.001497}
386
- ~ cache: set (/cache_controller/action6)
387
- ~ {:after_filters_time=>0.000548, :before_filters_time=>0.000235, :action_time=>0.000817}
388
- ~ cache: set (/cache_controller/action6)
389
- ~ {:after_filters_time=>0.00057, :before_filters_time=>0.000325, :action_time=>0.000951}
390
- ~ cache: set (/cache_controller/action6)
391
- ~ {:after_filters_time=>0.00043, :before_filters_time=>0.000217, :action_time=>0.000679}
392
- ~ cache: set (/cache_controller/action6/id1/id2)
393
- ~ {:after_filters_time=>0.001216, :before_filters_time=>0.000286, :action_time=>0.00153}
394
- ~ cache: set (/cache_controller/action6/id1/id2)
395
- ~ {:after_filters_time=>0.000472, :before_filters_time=>0.000228, :action_time=>0.000734}
396
- ~ cache: set (/cache_controller/action6)
397
- ~ {:after_filters_time=>0.000451, :before_filters_time=>0.000232, :action_time=>0.000713}
398
- ~ cache: set (/cache_controller/action6/id1/id2)
399
- ~ {:after_filters_time=>0.000982, :before_filters_time=>0.000246, :action_time=>0.001256}
400
- ~ cache: set (/cache_controller/action6/id1/id2)
401
- ~ {:after_filters_time=>0.000375, :before_filters_time=>0.000203, :action_time=>0.000604}
402
- ~ cache: set (/cache_controller/action6/id1/id2)
403
- ~ {:after_filters_time=>0.000868, :before_filters_time=>0.000203, :action_time=>0.001096}
404
- ~ cache: set (/cache_controller/action6/id1/id2)
405
- ~ {:after_filters_time=>0.000316, :before_filters_time=>0.000188, :action_time=>0.000527}
406
- ~ cache: set (/cache_controller/action6)
407
- ~ {:after_filters_time=>0.000301, :before_filters_time=>0.000264, :action_time=>0.000584}
408
- ~ cache: set (/cache_controller/action6/id1/id2)
409
- ~ {:after_filters_time=>0.000284, :before_filters_time=>0.000184, :action_time=>0.000487}
410
- ~ cache: set (/cache_controller/action6/id1/id2)
411
- ~ {:after_filters_time=>0.000294, :before_filters_time=>0.00013, :action_time=>0.000444}
412
- ~ cache: set (/cache_controller/action6/id1/id2)
413
- ~ {:after_filters_time=>0.000653, :before_filters_time=>0.000335, :action_time=>0.001034}
414
- ~ cache: set (/cache_controller/action7.css)
415
- ~ {:after_filters_time=>0.000679, :before_filters_time=>0.000226, :action_time=>0.000941}
416
- ~ cache: hit (/cache_controller/action7.css)
417
- ~ {:after_filters_time=>2.5e-05, :action_time=>0.000364}
418
- ~ cache: set (/cache_controller/action7.js)
419
- ~ {:after_filters_time=>0.000474, :before_filters_time=>0.000188, :action_time=>0.000696}
420
- ~ cache: hit (/cache_controller/action7.js)
421
- ~ {:after_filters_time=>2.0e-05, :action_time=>0.000274}
422
- ~ cache: set (/cache_controller/action7.xml)
423
- ~ {:after_filters_time=>0.000548, :before_filters_time=>0.000168, :action_time=>0.000902}
424
- ~ cache: hit (/cache_controller/action7.xml)
425
- ~ {:after_filters_time=>2.1e-05, :action_time=>0.000298}
426
- ~ cache: set (/cache_controller/action7.jpg)
427
- ~ {:after_filters_time=>0.000318, :before_filters_time=>0.000162, :action_time=>0.000504}
428
- ~ cache: hit (/cache_controller/action7.jpg)
429
- ~ {:after_filters_time=>1.9e-05, :action_time=>0.000241}
430
- ~ cache: set (/cache_controller/action7.html)
431
- ~ {:after_filters_time=>0.000294, :before_filters_time=>0.000153, :action_time=>0.000467}
432
- ~ cache: hit (/cache_controller/action7.html)
433
- ~ {:after_filters_time=>2.0e-05, :action_time=>0.000239}
@@ -1,162 +0,0 @@
1
- describe "merb-cache-action" do
2
-
3
- it "should cache action (action3)" do
4
- c = get("/cache_controller/action3")
5
- c.body.strip.should == "test action3"
6
- c.cached?("/cache_controller/action3").should be_true
7
- c.cached_action?("action3").should be_true
8
- c.cache_get("/cache_controller/action3").should == "test action3"
9
- end
10
-
11
- it "should expire action (action3)" do
12
- CACHE.expire_action "action3"
13
- CACHE.cache_get("/cache_controller/action3").should be_nil
14
- end
15
-
16
- it "should cache action (action3) with full path" do
17
- c = get("/cache_controller/action3/abc/456/ghi")
18
- c.body.strip.should == "test action3"
19
- c.cached?(c.request.path).should be_true
20
- c.cache_get(c.request.path).should == "test action3"
21
- end
22
-
23
- it "should expire action (action3) with full path" do
24
- c = get("/cache_controller/action3/abc/456/ghi")
25
- c.expire_action(:key => c.request.path)
26
- c.cache_get(c.request.path).should be_nil
27
- end
28
-
29
- it "should expire action (action4) after 3 seconds" do
30
- c = get("/cache_controller/action4")
31
- c.body.strip.should == "test action4"
32
- c.cached?("/cache_controller/action4").should be_true
33
- c.cache_get("/cache_controller/action4").should == "test action4"
34
- sleep 4
35
- c.cache_get("/cache_controller/action4").should be_nil
36
- c.cached_action?(:action => "action4").should be_false
37
- end
38
-
39
- it "should cache action with full path (action4) and expire in 3 seconds" do
40
- CACHE.expire_action :match => true, :action => "action4"
41
- CACHE.cached_action?(:action => "action4", :params => %w(path to nowhere)).should be_false
42
- c = get("/cache_controller/action4/path/to/nowhere/")
43
- c.cached_action?(:action => "action4", :params => %w(path to nowhere)).should be_true
44
- sleep 3.5
45
- c.cache_get("/cache_controller/action4/path/to/nowhere").should be_nil
46
- c.cached_action?(:action => "action4", :params => %w(path to nowhere)).should be_false
47
- end
48
-
49
- it "should expire action in many ways" do
50
- c = get("/cache_controller/action4")
51
- CACHE.expire_action("action4")
52
- CACHE.cached_action?("action4").should be_false
53
-
54
- c = get("/cache_controller/action4")
55
- CACHE.expire_action(:match => "/cache_control")
56
- CACHE.cached_action?(:action => "action4").should be_false
57
-
58
- c = get("/cache_controller/action4")
59
- CACHE.expire_action(:action => "action4")
60
- CACHE.cached_action?(:action => "action4").should be_false
61
-
62
- c = get("/cache_controller/action4/id1/id2")
63
- CACHE.expire_action(:action => "action4", :params => %w(id1 id2))
64
- CACHE.cached_action?(:action => "action4", :params => %w(id1 id2)).should be_false
65
-
66
- c = get("/cache_controller/action4/id1/id2")
67
- CACHE.expire_action(:action => "action4", :match => true)
68
- CACHE.cached_action?(:action => "action4", :params => %w(id1 id2)).should be_false
69
-
70
- c = get("/cache_controller/action4")
71
- CACHE.expire_action(:action => "action4", :controller => "cache_controller")
72
- CACHE.cached_action?(:action => "action4", :controller => "cache_controller").should be_false
73
-
74
- c = get("/cache_controller/action4/id1/id2")
75
- CACHE.expire_action(:action => "action4", :params => %w(id1), :match => true)
76
- CACHE.cached_action?(:action => "action4", :params => %w(id1 id2)).should be_false
77
-
78
- c = get("/cache_controller/action4/id1/id2")
79
- CACHE.expire_action(:action => "action4", :controller => "cache_controller", :match => true)
80
- CACHE.cached_action?(:action => "action4", :params => %w(id1 id2)).should be_false
81
-
82
- c = get("/cache_controller/action4/id1/id2")
83
- CACHE.expire_action(:action => "action4", :controller => "cache_controller", :params => %w(id1), :match => true)
84
- CACHE.cached_action?(:action => "action4", :params => %w(id1 id2)).should be_false
85
-
86
- c = get("/cache_controller/action4/id1/id2")
87
- CACHE.expire_action(:action => "action4", :controller => "cache_controller", :params => %w(id1 id2))
88
- CACHE.cached_action?(:action => "action4", :controller => "cache_controller", :params => %w(id1 id2)).should be_false
89
-
90
- c = get("/cache_controller/action4")
91
- CACHE.expire_action(:key => "/cache_controller/action4")
92
- CACHE.cached_action?(:key => "/cache_controller/action4").should be_false
93
- c = get("/cache_controller/action4/id1/id2")
94
- CACHE.expire_action(:key => "/cache_controller/action4", :params => %w(id1 id2))
95
- CACHE.cached_action?(:key => "/cache_controller/action4", :params => %w(id1 id2)).should be_false
96
-
97
- c = get("/cache_controller/action4/id1/id2")
98
- CACHE.expire_action(:key => "/cache_controller/action4/id1", :match => true)
99
- CACHE.cached_action?(:key => "/cache_controller/action4/id1/id2").should be_false
100
-
101
- c = get("/cache_controller/action4/id1/id2")
102
- CACHE.expire_action(:key => "/cache_controller/action4", :params => %w(id1), :match => true)
103
- CACHE.cached_action?(:key => "/cache_controller/action4/id1/id2").should be_false
104
- end
105
-
106
- it "should allow :if conditions with procs" do
107
- c = get("/cache_controller/action8")
108
- CACHE.cached_action?(:key => "/cache_controller/action8").should be_false
109
-
110
- c = get("/cache_controller/action8/cache")
111
- CACHE.cached_action?(:key => "/cache_controller/action8/cache").should be_true
112
- end
113
-
114
- it "should allow :unless conditions with procs" do
115
- c = get("/cache_controller/action9")
116
- CACHE.cached_action?(:key => "/cache_controller/action9").should be_false
117
-
118
- c = get("/cache_controller/action9/cache")
119
- CACHE.cached_action?(:key => "/cache_controller/action9/cache").should be_true
120
- end
121
-
122
- it "should allow :if conditions with symbols" do
123
- c = get("/cache_controller/action10")
124
- CACHE.cached_action?(:key => "/cache_controller/action10").should be_false
125
-
126
- c = get("/cache_controller/action10/cache")
127
- CACHE.cached_action?(:key => "/cache_controller/action10/cache").should be_true
128
- end
129
-
130
- it "should allow :unless conditions with symbols" do
131
- c = get("/cache_controller/action11")
132
- CACHE.cached_action?(:key => "/cache_controller/action11").should be_false
133
-
134
- c = get("/cache_controller/action11/cache")
135
- CACHE.cached_action?(:key => "/cache_controller/action11/cache").should be_true
136
- end
137
- end
138
-
139
- describe "merb-cache-actions" do
140
- it "should cache multiple actions passed as arguments to it (cache_actions_1, cache_actions_2, cache_actions_3)" do
141
- c = get("/cache_controller/cache_actions_1")
142
- c.body.strip.should == "test cache_actions_1"
143
- c.cached?("/cache_controller/cache_actions_1").should be_true
144
- c.cached_action?("cache_actions_1").should be_true
145
- c.cache_get("/cache_controller/cache_actions_1").should == "test cache_actions_1"
146
-
147
- c = get("/cache_controller/cache_actions_2")
148
- c.body.strip.should == "test cache_actions_2"
149
- c.cached?("/cache_controller/cache_actions_2").should be_true
150
- c.cached_action?("cache_actions_2").should be_true
151
- c.cache_get("/cache_controller/cache_actions_2").should == "test cache_actions_2"
152
- sleep 4
153
- c.cache_get("/cache_controller/cache_actions_2").should be_nil
154
- c.cached_action?(:action => "cache_actions_2").should be_false
155
-
156
- c = get("/cache_controller/cache_actions_3")
157
- CACHE.cached_action?(:key => "/cache_controller/cache_actions_3").should be_true
158
-
159
- c = get("/cache_controller/cache_actions_3/cache")
160
- CACHE.cached_action?(:key => "/cache_controller/cache_actions_3/cache").should be_false
161
- end
162
- end