From 6ead07550059c14306f2c74c564b23793f033bb8 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 14 Aug 2026 13:06:45 -1000 Subject: Drop the Last-Modified, Expires and ETag headers --- source/cgit.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'source/cgit.c') diff --git a/source/cgit.c b/source/cgit.c index 53a33ca..ac8922b 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -46,10 +46,6 @@ // a snapshots mask can carry. #define ALL_SNAPSHOT_FORMATS 0xFF -// An Expires header has no way of saying never, so a page whose ttl is -// negative claims ten years. -#define NEVER_EXPIRES_SECONDS (10 * 365 * 24 * 60 * 60) - /* * The first branch found is the fallback, so a repository whose default branch * does not exist still has something to show. @@ -165,9 +161,6 @@ static void prepare_context(void) ctx.page.charset = PAGE_ENCODING; ctx.page.filename = NULL; ctx.page.size = 0; - ctx.page.modified = time(NULL); - ctx.page.expires = ctx.page.modified; - ctx.page.etag = NULL; string_list_init_dup(&ctx.cfg.mimetypes); if (ctx.env.script_name) ctx.cfg.script_name = xstrdup(ctx.env.script_name); @@ -1218,10 +1211,6 @@ int cmd_main(int argc, const char **argv) authenticate_cookie(); ttl = calc_ttl(); - if (ttl < 0) - ctx.page.expires += NEVER_EXPIRES_SECONDS; - else - ctx.page.expires += ttl * 60; // An unauthenticated request gets a body meant for one visitor, and a // HEAD request stops after the headers. if (!ctx.env.authenticated || -- cgit v2.8.0