blob: 010dd5ccb02fac5da080833331dabdcd8ef165cd [file] [log] [blame]
Lars Hjemli25105d72006-12-10 22:31:36 +01001
Lars Hjemlidcef2572006-12-13 02:06:29 +01002 cgit - cgi for git
Lars Hjemli25105d72006-12-10 22:31:36 +01003
4
Lars Hjemlidcef2572006-12-13 02:06:29 +01005This is an attempt to create a fast web interface for the git scm, using a
6frontside cache to decrease server io-pressure.
Lars Hjemli25105d72006-12-10 22:31:36 +01007
Lars Hjemlidcef2572006-12-13 02:06:29 +01008When cgit is invoked, it looks for a cached page matching the request. If no
9such cachefile exist (or it has expired), it is (re)generated. Finally, the
10cachefile is returned to the client.
Lars Hjemli25105d72006-12-10 22:31:36 +010011
Lars Hjemlidcef2572006-12-13 02:06:29 +010012If the cachefile has expired, but cgit is unable to lock the cachefile, the
13client will get the stale cachefile after all. This is done to favour page
14throughput over page freshness.
Lars Hjemli25105d72006-12-10 22:31:36 +010015
Lars Hjemlidcef2572006-12-13 02:06:29 +010016Also, when a cachefile is generated, a few cache-related http-headers are
17created: "Modified" is set to current time(2), while "Expires" is set to
18time(2) + <cachefile TTL> * 60 (unless the TTL is negative, in which case it
19is read as "60 * 60 * 24 * 365"). This is done to avoid repeated requests for
20already visited pages.
Lars Hjemli25105d72006-12-10 22:31:36 +010021
Lars Hjemlidcef2572006-12-13 02:06:29 +010022The following cache-related options can be set in /etc/cgitrc:
Lars Hjemli25105d72006-12-10 22:31:36 +010023
Lars Hjemlidcef2572006-12-13 02:06:29 +010024 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
30The cachefiles are split into different directories, based on the requested
31repository and page:
32
33 Repo listing: <cachedir>/index.html
34 Repo summary: <cachedir>/<repo>/index.html
35 Repo subpage: <cachedir>/<repo>/<page>/<querystring>.html