From: Andy Spencer Date: Mon, 14 Feb 2011 05:26:29 +0000 (+0000) Subject: Fix caching bugs with some http servers X-Git-Tag: v0.5~15 X-Git-Url: http://pileus.org/git/?p=grits;a=commitdiff_plain;h=75df11f7088dac5301deec551d7458d9572f1848 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. --- 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 */