ctx.cfg.cache_static_ttl = atoi(value);
else if (!strcmp(name, "cache-dynamic-ttl"))
ctx.cfg.cache_dynamic_ttl = atoi(value);
+ else if (!strcmp(name, "cache-about-ttl"))
+ ctx.cfg.cache_about_ttl = atoi(value);
else if (!strcmp(name, "case-sensitive-sort"))
ctx.cfg.case_sensitive_sort = atoi(value);
else if (!strcmp(name, "about-filter"))
ctx->cfg.agefile = "info/web/last-modified";
ctx->cfg.nocache = 0;
ctx->cfg.cache_size = 0;
- ctx->cfg.cache_dynamic_ttl = 5;
ctx->cfg.cache_max_create_time = 5;
- ctx->cfg.cache_repo_ttl = 5;
ctx->cfg.cache_root = CGIT_CACHE_ROOT;
+ ctx->cfg.cache_about_ttl = 15;
+ ctx->cfg.cache_repo_ttl = 5;
ctx->cfg.cache_root_ttl = 5;
ctx->cfg.cache_scanrc_ttl = 15;
+ ctx->cfg.cache_dynamic_ttl = 5;
ctx->cfg.cache_static_ttl = -1;
ctx->cfg.case_sensitive_sort = 1;
ctx->cfg.branch_sort = 0;
ctx->cfg.commit_sort = 0;
ctx->cfg.css = "/cgit.css";
ctx->cfg.logo = "/cgit.png";
+ ctx->cfg.favicon = "/favicon.ico";
ctx->cfg.local_time = 0;
ctx->cfg.enable_http_clone = 1;
ctx->cfg.enable_index_owner = 1;
if (!ctx.qry.page)
return ctx.cfg.cache_repo_ttl;
+ if (!strcmp(ctx.qry.page, "about"))
+ return ctx.cfg.cache_about_ttl;
+
if (ctx.qry.has_symref)
return ctx.cfg.cache_dynamic_ttl;
}
ttl = calc_ttl();
- ctx.page.expires += ttl * 60;
+ if (ttl < 0)
+ ctx.page.expires += 10 * 365 * 24 * 60 * 60; /* 10 years */
+ else
+ ctx.page.expires += ttl * 60;
if (ctx.env.request_method && !strcmp(ctx.env.request_method, "HEAD"))
ctx.cfg.nocache = 1;
if (ctx.cfg.nocache)