Merge branch 'plain-etag' Conflicts: ui-shared.c
Lars Hjemli hjemli@gmail.com
Sat, 25 Jul 2009 11:59:22 +0200
4 files changed,
12 insertions(+),
0 deletions(-)
M
cgit.c
→
cgit.c
@@ -206,6 +206,7 @@ ctx->page.filename = NULL;
ctx->page.size = 0; ctx->page.modified = time(NULL); ctx->page.expires = ctx->page.modified; + ctx->page.etag = NULL; } struct refmatch {@@ -431,6 +432,7 @@
int main(int argc, const char **argv) { const char *cgit_config_env = getenv("CGIT_CONFIG"); + const char *method = getenv("REQUEST_METHOD"); const char *path; char *qry; int err, ttl;@@ -477,6 +479,8 @@ }
ttl = calc_ttl(); ctx.page.expires += ttl*60; + if (method && !strcmp(method, "HEAD")) + ctx.cfg.nocache = 1; if (ctx.cfg.nocache) ctx.cfg.cache_size = 0; err = cache_process(ctx.cfg.cache_size, ctx.cfg.cache_root,
M
ui-plain.c
→
ui-plain.c
@@ -37,6 +37,7 @@ else
ctx.page.mimetype = "text/plain"; ctx.page.filename = fmt("%s", path); ctx.page.size = size; + ctx.page.etag = sha1_to_hex(sha1); cgit_print_http_headers(&ctx); html_raw(buf, size); match = 1;