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.
This commit is contained in:
Michael Drake 2019-11-10 12:39:43 +00:00
parent 0dfbc80587
commit ab4eab5706
1 changed files with 6 additions and 0 deletions

View File

@ -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 =