Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 2978 Bytes
1 | Configuration |
2 | ============= |
3 | |
4 | __Rack::Cache__ includes a configuration system that can be used to specify |
5 | fairly sophisticated cache policy on a global or per-request basis. |
6 | |
7 | <a id='setopt'></a> |
8 | |
9 | Setting Cache Options |
10 | --------------------- |
11 | |
12 | Cache options can be set when the __Rack::Cache__ object is created, |
13 | or by setting a `rack-cache.<option>` variable in __Rack__'s |
14 | __Environment__. |
15 | |
16 | When the __Rack::Cache__ object is instantiated: |
17 | |
18 | use Rack::Cache, |
19 | :verbose => true, |
20 | :metastore => 'memcached://localhost:11211/', |
21 | :entitystore => 'file:/var/cache/rack' |
22 | |
23 | Using __Rack__'s __Environment__: |
24 | |
25 | env.merge!( |
26 | 'rack-cache.verbose' => true, |
27 | 'rack-cache.metastore' => 'memcached://localhost:11211/', |
28 | 'rack-cache.entitystore' => 'file:/var/cache/rack' |
29 | ) |
30 | |
31 | <a id='options'></a> |
32 | |
33 | Cache Option Reference |
34 | ---------------------- |
35 | |
36 | Use the following options to customize __Rack::Cache__: |
37 | |
38 | ### `verbose` |
39 | |
40 | Boolean specifying whether verbose trace logging is enabled. This option is |
41 | currently enabled (`true`) by default but is likely to be disabled (`false`) in |
42 | a future release. All log output is written to the `rack.errors` stream, which |
43 | is typically set to `STDERR`. |
44 | |
45 | The `trace`, `info`, `warn`, and `error` methods can be used within the |
46 | configuration context to write messages to the errors stream. |
47 | |
48 | ### `default_ttl` |
49 | |
50 | An integer specifying the number of seconds a cached object should be considered |
51 | "fresh" when no explicit freshness information is provided in a response. |
52 | Explicit `Cache-Control` or `Expires` response headers always override this |
53 | value. The `default_ttl` option defaults to `0`, meaning responses without |
54 | explicit freshness information are considered immediately "stale" and will not |
55 | be served from cache without validation. |
56 | |
57 | ### `metastore` |
58 | |
59 | A URI specifying the __MetaStore__ implementation used to store request/response |
60 | meta information. See the [Rack::Cache Storage Documentation](storage.html) |
61 | for detailed information on different storage implementations. |
62 | |
63 | If no metastore is specified, the `heap:/` store is assumed. This implementation |
64 | has significant draw-backs so explicit configuration is recommended. |
65 | |
66 | ### `entitystore` |
67 | |
68 | A URI specifying the __EntityStore__ implementation used to store |
69 | response bodies. See the [Rack::Cache Storage Documentation](storage.html) |
70 | for detailed information on different storage implementations. |
71 | |
72 | If no entitystore is specified, the `heap:/` store is assumed. This |
73 | implementation has significant draw-backs so explicit configuration is |
74 | recommended. |
75 | |
76 | ### `private_headers` |
77 | |
78 | An array of request header names that cause the response to be treated with |
79 | private cache control semantics. The default value is `['Authorization', 'Cookie']`. |
80 | If any of these headers are present in the request, the response is considered |
81 | private and will not be cached _unless_ the response is explicitly marked public |
82 | (e.g., `Cache-Control: public`). |
83 | |
84 | ### `cache_key` |
85 | |
86 | TODO: Document custom cache keys |