]> granicus.if.org Git - cgit/commitdiff
ui-shared: cache errors for "dynamic TTL"
authorJohn Keeping <john@keeping.me.uk>
Fri, 14 Aug 2015 11:47:22 +0000 (12:47 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 14 Aug 2015 13:46:51 +0000 (15:46 +0200)
Most errors we generate are (potentially) transient, such as
non-existent object IDs so we don't want them to be cached forever.

Signed-off-by: John Keeping <john@keeping.me.uk>
ui-shared.c

index de06256d447da52d9af7178fedd62a1ff8bb6485..89c48979586edaa7dc6d7df1aa133f288638b70e 100644 (file)
@@ -791,6 +791,7 @@ void cgit_print_docend(void)
 void cgit_print_error_page(int code, const char *msg, const char *fmt, ...)
 {
        va_list ap;
+       ctx.page.expires = ctx.cfg.cache_dynamic_ttl;
        ctx.page.status = code;
        ctx.page.statusmsg = msg;
        cgit_print_http_headers();