From c53ab294b5d515b5d39418ca1ac346f40297cf84 Mon Sep 17 00:00:00 2001 From: Pierre-Luc Beaudoin Date: Sun, 30 Aug 2009 11:08:52 -0400 Subject: [PATCH] Respect OSM tile usage policy We'll have to use 7 days expiration until we can add the http Expires data to tiles (after API freeze) http://wiki.openstreetmap.org/wiki/Tile_usage_policy --- champlain/champlain-cache.c | 2 +- champlain/champlain-network-map-source.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/champlain/champlain-cache.c b/champlain/champlain-cache.c index 5379152..505440e 100644 --- a/champlain/champlain-cache.c +++ b/champlain/champlain-cache.c @@ -462,7 +462,7 @@ champlain_cache_tile_is_expired (ChamplainCache *self, gboolean validate_cache = FALSE; g_get_current_time (&now); - g_time_val_add (&now, (-24ul * 60ul * 60ul * 1000ul * 1000ul)); // Cache expires 1 day + g_time_val_add (&now, (-24ul * 60ul * 60ul * 1000ul * 1000ul * 7ul)); // Cache expires 7 days validate_cache = modified_time->tv_sec < now.tv_sec; return validate_cache; diff --git a/champlain/champlain-network-map-source.c b/champlain/champlain-network-map-source.c index 596fcbf..1460982 100644 --- a/champlain/champlain-network-map-source.c +++ b/champlain/champlain-network-map-source.c @@ -625,7 +625,7 @@ fill_tile (ChamplainMapSource *map_source, NULL); g_object_set (G_OBJECT (soup_session), "user-agent", "libchamplain/" CHAMPLAIN_VERSION_S, - "max-conns-per-host", 8, NULL); // This is the same has Firefox + "max-conns-per-host", 2, NULL); // This is as required by OSM g_object_add_weak_pointer (G_OBJECT (soup_session), (gpointer *) &soup_session); } -- 2.39.5