From: Jason A. Donenfeld Date: Tue, 28 May 2013 14:43:02 +0000 (+0200) Subject: cache: id means static, even if head is specified too X-Git-Url: https://gitweb.ps.run/ps-cgit/commitdiff_plain/00e3a3ecda77bf5ab149db0940c549f1bb618de4 cache: id means static, even if head is specified too Pages like /commit?h=wip&id=8a335ce618ba77fbf05148d6f8be17bd48ba4340 were being marked as dynamic, because of h=wip, when it should be static, because of id=. Signed-off-by: Jason A. Donenfeld --- diff --git a/cgit.c b/cgit.c index a45ce1f..861352a 100644 --- a/cgit.c +++ b/cgit.c @@ -928,12 +928,12 @@ static int calc_ttl() if (!strcmp(ctx.qry.page, "about")) return ctx.cfg.cache_about_ttl; - if (ctx.qry.has_symref) - return ctx.cfg.cache_dynamic_ttl; - if (ctx.qry.has_sha1) return ctx.cfg.cache_static_ttl; + if (ctx.qry.has_symref) + return ctx.cfg.cache_dynamic_ttl; + return ctx.cfg.cache_repo_ttl; }