diff options
author | Lars Hjemli <hjemli@gmail.com> | 2009-07-25 18:59:22 (JST) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-07-25 18:59:22 (JST) |
commit | 681fdc45473143de3f3c5f69fbc7b94f5d6b0b75 (patch) | |
tree | 3bfca05875524bee0e5444fb791707bc3e593dbd /cgit.c | |
parent | 7e5c048505efe1902fb476cc2cb3160ff7df013d (diff) | |
parent | 3ff58ddd51bcbcbc9b7649bad1a39aa98af4b49f (diff) | |
download | cgit-681fdc45473143de3f3c5f69fbc7b94f5d6b0b75.zip cgit-681fdc45473143de3f3c5f69fbc7b94f5d6b0b75.tar.gz |
Merge branch 'plain-etag'
Conflicts:
ui-shared.c
Diffstat (limited to 'cgit.c')
-rw-r--r-- | cgit.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -206,6 +206,7 @@ static void prepare_context(struct cgit_context *ctx) | |||
206 | ctx->page.size = 0; | 206 | ctx->page.size = 0; |
207 | ctx->page.modified = time(NULL); | 207 | ctx->page.modified = time(NULL); |
208 | ctx->page.expires = ctx->page.modified; | 208 | ctx->page.expires = ctx->page.modified; |
209 | ctx->page.etag = NULL; | ||
209 | } | 210 | } |
210 | 211 | ||
211 | struct refmatch { | 212 | struct refmatch { |
@@ -431,6 +432,7 @@ static int calc_ttl() | |||
431 | int main(int argc, const char **argv) | 432 | int main(int argc, const char **argv) |
432 | { | 433 | { |
433 | const char *cgit_config_env = getenv("CGIT_CONFIG"); | 434 | const char *cgit_config_env = getenv("CGIT_CONFIG"); |
435 | const char *method = getenv("REQUEST_METHOD"); | ||
434 | const char *path; | 436 | const char *path; |
435 | char *qry; | 437 | char *qry; |
436 | int err, ttl; | 438 | int err, ttl; |
@@ -477,6 +479,8 @@ int main(int argc, const char **argv) | |||
477 | 479 | ||
478 | ttl = calc_ttl(); | 480 | ttl = calc_ttl(); |
479 | ctx.page.expires += ttl*60; | 481 | ctx.page.expires += ttl*60; |
482 | if (method && !strcmp(method, "HEAD")) | ||
483 | ctx.cfg.nocache = 1; | ||
480 | if (ctx.cfg.nocache) | 484 | if (ctx.cfg.nocache) |
481 | ctx.cfg.cache_size = 0; | 485 | ctx.cfg.cache_size = 0; |
482 | err = cache_process(ctx.cfg.cache_size, ctx.cfg.cache_root, | 486 | err = cache_process(ctx.cfg.cache_size, ctx.cfg.cache_root, |