[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgit
Subject:    [PATCH v2 22/22] ui-shared: cache errors for "dynamic TTL"
From:       John Keeping <john () keeping ! me ! uk>
Date:       2015-08-14 11:47:22
Message-ID: 91853b9ed4c92d5c3b9acc23e77aaa31d829626a.1439552492.git.john () keeping ! me ! uk
[Download RAW message or body]

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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui-shared.c b/ui-shared.c
index de06256..89c4897 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -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();
-- 
2.5.0.466.g9af26fa

_______________________________________________
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic