diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Drop the Last-Modified, Expires and ETag headers
Diffstat (limited to 'source/cgit.c')
-rw-r--r--source/cgit.c11
1 file changed, 0 insertions, 11 deletions
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 ||