summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2019-11-10 12:39:43 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2019-11-10 14:36:40 +0000
commitab4eab5706ac6df3a282d1e2fa880d2d40a9eead (patch)
tree76b2550c0012cd0633967e92a6036ac8f216fc65 /content
parent0dfbc8058784a63a7a14651f0098b3b391c24dfd (diff)
downloadnetsurf-ab4eab5706ac6df3a282d1e2fa880d2d40a9eead.tar.gz
netsurf-ab4eab5706ac6df3a282d1e2fa880d2d40a9eead.tar.bz2
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.
Diffstat (limited to 'content')
-rw-r--r--content/fetchers/data.c6
1 files changed, 6 insertions, 0 deletions
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
@@ -283,6 +283,12 @@ static void fetch_data_poll(lwc_string *scheme)
}
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 =
(const uint8_t *) c->data;