From ab4eab5706ac6df3a282d1e2fa880d2d40a9eead Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 10 Nov 2019 12:39:43 +0000 Subject: [PATCH] Data fetcher: Add Cache-Control header with max-age of a year. Data URLs can't change, we want to assume they're fresh for as long as we can. --- content/fetchers/data.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/fetchers/data.c b/content/fetchers/data.c index 0ebe849ec..fdcfe647b 100644 --- a/content/fetchers/data.c +++ b/content/fetchers/data.c @@ -282,6 +282,12 @@ static void fetch_data_poll(lwc_string *scheme) PRIsizet, c->datalen); } + if (c->aborted == false) { + /* Set max-age to 1 year. */ + fetch_data_send_header(c, "Cache-Control: " + "max-age=31536000"); + } + if (c->aborted == false) { msg.type = FETCH_DATA; msg.data.header_or_data.buf =