Resource fetcher: Add Cache-Control header with max-age of a year.

Resource URLs can't change, we want to assume they're fresh for
as long as we can.
This commit is contained in:
Michael Drake 2019-11-10 12:41:15 +00:00
parent ab4eab5706
commit 66401b7fa6
1 changed files with 5 additions and 0 deletions

View File

@ -195,6 +195,11 @@ static bool fetch_resource_data_handler(struct fetch_resource_context *ctx)
goto fetch_resource_data_aborted;
}
/* create max-age of 1 year */
if (fetch_resource_send_header(ctx,
"Cache-Control: max-age=31536000")) {
goto fetch_resource_data_aborted;
}
msg.type = FETCH_DATA;
msg.data.header_or_data.buf = (const uint8_t *) ctx->entry->data;