improve cache control support for /wire, /keys and legal
This commit is contained in:
parent
fac01f140f
commit
3db8f0f22d
@ -1703,6 +1703,16 @@ setup_general_response_headers (struct TEH_KeyStateHandle *ksh,
|
|||||||
= GNUNET_TIME_timestamp_min (m,
|
= GNUNET_TIME_timestamp_min (m,
|
||||||
ksh->signature_expires);
|
ksh->signature_expires);
|
||||||
}
|
}
|
||||||
|
/* Set cache control headers: our response varies depending on these headers */
|
||||||
|
GNUNET_break (MHD_YES ==
|
||||||
|
MHD_add_response_header (response,
|
||||||
|
MHD_HTTP_HEADER_VARY,
|
||||||
|
MHD_HTTP_HEADER_ACCEPT_ENCODING));
|
||||||
|
/* Information is always public, revalidate after 1 hour */
|
||||||
|
GNUNET_break (MHD_YES ==
|
||||||
|
MHD_add_response_header (response,
|
||||||
|
MHD_HTTP_HEADER_CACHE_CONTROL,
|
||||||
|
"public,max-age=3600"));
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,6 +483,17 @@ build_wire_state (void)
|
|||||||
wsh->dat));
|
wsh->dat));
|
||||||
}
|
}
|
||||||
TALER_MHD_add_global_headers (wsh->wire_reply);
|
TALER_MHD_add_global_headers (wsh->wire_reply);
|
||||||
|
/* Set cache control headers: our response varies depending on these headers */
|
||||||
|
GNUNET_break (MHD_YES ==
|
||||||
|
MHD_add_response_header (wsh->wire_reply,
|
||||||
|
MHD_HTTP_HEADER_VARY,
|
||||||
|
MHD_HTTP_HEADER_ACCEPT_ENCODING));
|
||||||
|
/* Information is always public, revalidate after 1 day */
|
||||||
|
GNUNET_break (MHD_YES ==
|
||||||
|
MHD_add_response_header (wsh->wire_reply,
|
||||||
|
MHD_HTTP_HEADER_CACHE_CONTROL,
|
||||||
|
"public,max-age=86400"));
|
||||||
|
|
||||||
{
|
{
|
||||||
struct GNUNET_HashCode h;
|
struct GNUNET_HashCode h;
|
||||||
char etag[sizeof (h) * 2];
|
char etag[sizeof (h) * 2];
|
||||||
|
@ -306,7 +306,18 @@ TALER_MHD_reply_legal (struct MHD_Connection *conn,
|
|||||||
MHD_add_response_header (resp,
|
MHD_add_response_header (resp,
|
||||||
MHD_HTTP_HEADER_EXPIRES,
|
MHD_HTTP_HEADER_EXPIRES,
|
||||||
dat));
|
dat));
|
||||||
|
/* Set cache control headers: our response varies depending on these headers */
|
||||||
|
GNUNET_break (MHD_YES ==
|
||||||
|
MHD_add_response_header (resp,
|
||||||
|
MHD_HTTP_HEADER_VARY,
|
||||||
|
MHD_HTTP_HEADER_ACCEPT_LANGUAGE ","
|
||||||
|
MHD_HTTP_HEADER_ACCEPT ","
|
||||||
|
MHD_HTTP_HEADER_ACCEPT_ENCODING));
|
||||||
|
/* Information is always public, revalidate after 10 days */
|
||||||
|
GNUNET_break (MHD_YES ==
|
||||||
|
MHD_add_response_header (resp,
|
||||||
|
MHD_HTTP_HEADER_CACHE_CONTROL,
|
||||||
|
"public max-age=864000"));
|
||||||
if (NULL != legal)
|
if (NULL != legal)
|
||||||
GNUNET_break (MHD_YES ==
|
GNUNET_break (MHD_YES ==
|
||||||
MHD_add_response_header (resp,
|
MHD_add_response_header (resp,
|
||||||
|
Loading…
Reference in New Issue
Block a user