X-Git-Url: https://git.octo.it/?p=collection4.git;a=blobdiff_plain;f=src%2Faction_show_graph_json.c;h=402627ce36eb7e9a810ebd1e5698bca6de057473;hp=a182a626baf620e9ed456c95a10cd1b70bb05689;hb=d746867e2a940a8f752e781c866243f775777338;hpb=a0ce16dc07cbdb39a408fee847bfde5ca808406e diff --git a/src/action_show_graph_json.c b/src/action_show_graph_json.c index a182a62..402627c 100644 --- a/src/action_show_graph_json.c +++ b/src/action_show_graph_json.c @@ -79,6 +79,11 @@ static int show_instance_cb (graph_instance_t *inst, /* {{{ */ int action_show_graph_json (void) /* {{{ */ { show_graph_data_t data; + + time_t now; + char time_buffer[128]; + int status; + char title[1024]; graph_ident_t *ident; char *ident_json; @@ -100,7 +105,15 @@ int action_show_graph_json (void) /* {{{ */ return (ENOMEM); } - printf ("Content-Type: text/plain\n\n"); + printf ("Content-Type: text/plain\n"); + + now = time (NULL); + status = time_to_rfc1123 (now + 300, time_buffer, sizeof (time_buffer)); + if (status == 0) + printf ("Expires: %s\n" + "Cache-Control: public\n", + time_buffer); + printf ("\n"); memset (title, 0, sizeof (title)); graph_get_title (data.cfg, title, sizeof (title));