From 75df11f7088dac5301deec551d7458d9572f1848 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Mon, 14 Feb 2011 05:26:29 +0000 Subject: [PATCH] Fix caching bugs with some http servers Some server (e.g. weather.gov) send old versions of index files which causes grits_http_available to return incorrect information. Setting `Cache-Control: max-age=0' fixes this. --- src/data/grits-http.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/data/grits-http.c b/src/data/grits-http.c index c4b4484..943441d 100644 --- a/src/data/grits-http.c +++ b/src/data/grits-http.c @@ -179,6 +179,9 @@ gchar *grits_http_fetch(GritsHttp *http, const gchar *uri, const char *local, g_error("message is null, cannot parse uri"); g_signal_connect(message, "got-chunk", G_CALLBACK(_chunk_cb), &info); soup_message_headers_set_range(message->request_headers, ftell(fp), -1); + if (mode == GRITS_REFRESH) + soup_message_headers_replace(message->request_headers, + "Cache-Control", "max-age=0"); soup_session_send_message(http->soup, message); /* Close file */ -- 2.43.2