diff options
Diffstat (limited to 'README')
-rw-r--r-- | README | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/README b/README index 010dd5c..17e284e 100644 --- a/README +++ b/README | |||
@@ -2,34 +2,38 @@ | |||
2 | cgit - cgi for git | 2 | cgit - cgi for git |
3 | 3 | ||
4 | 4 | ||
5 | This is an attempt to create a fast web interface for the git scm, using a | 5 | This is an attempt to create a fast web interface for the git scm, using a |
6 | frontside cache to decrease server io-pressure. | 6 | builtin cache to decrease server io-pressure. |
7 | 7 | ||
8 | When cgit is invoked, it looks for a cached page matching the request. If no | ||
9 | such cachefile exist (or it has expired), it is (re)generated. Finally, the | ||
10 | cachefile is returned to the client. | ||
11 | 8 | ||
12 | If the cachefile has expired, but cgit is unable to lock the cachefile, the | 9 | Installation |
13 | client will get the stale cachefile after all. This is done to favour page | 10 | |
14 | throughput over page freshness. | 11 | $ $EDITOR Makefile |
12 | $ make | ||
13 | $ sudo make install | ||
14 | |||
15 | Note: cgit requires the git and xdiff libraries. Currently, the makefile | ||
16 | expects these files to be found in '../git/libgit.a' and '../git/xdiff/lib.a', | ||
17 | where they will be if you have built git from source in a parallell directory. | ||
18 | |||
15 | 19 | ||
16 | Also, when a cachefile is generated, a few cache-related http-headers are | 20 | Runtime configuration |
17 | created: "Modified" is set to current time(2), while "Expires" is set to | ||
18 | time(2) + <cachefile TTL> * 60 (unless the TTL is negative, in which case it | ||
19 | is read as "60 * 60 * 24 * 365"). This is done to avoid repeated requests for | ||
20 | already visited pages. | ||
21 | 21 | ||
22 | The following cache-related options can be set in /etc/cgitrc: | 22 | The file /etc/cgitrc is read by cgit before handling a request. A template |
23 | cgitrc is shipped with the sources, and all parameters and default values | ||
24 | can be found in this file. | ||
23 | 25 | ||
24 | cache-root=<path> root directory for cache files | ||
25 | cache-root-ttl=<min> TTL for the repo listing page | ||
26 | cache-repo-ttl=<min> TTL for repo summary pages | ||
27 | cache-dynamic-ttl=<min> TTL for pages with symbolic references | ||
28 | cache-static-ttl=<min> TTL for pages with sha1 references | ||
29 | 26 | ||
30 | The cachefiles are split into different directories, based on the requested | 27 | The cache |
31 | repository and page: | 28 | |
29 | When cgit is invoked it looks for a cachefile matching the request and | ||
30 | returns it to the client. If no such cachefile exist (or if it has expired), | ||
31 | the content for the request is written into the proper cachefile before the | ||
32 | file is returned. | ||
33 | |||
34 | If the cachefile has expired but cgit is unable to obtain a lock for it, the | ||
35 | stale cachefile is returned to the client. This is done to favour page | ||
36 | throughput over page freshness. | ||
32 | 37 | ||
33 | Repo listing: <cachedir>/index.html | 38 | The generated content contains the complete response to the client, including |
34 | Repo summary: <cachedir>/<repo>/index.html | 39 | the http-headers "Modified" and "Expires". |
35 | Repo subpage: <cachedir>/<repo>/<page>/<querystring>.html | ||