From 1e0def87fd4c4c5449586a9853255ae6f35ce584 Mon Sep 17 00:00:00 2001 From: link2xt Date: Mon, 13 Oct 2025 14:51:26 +0000 Subject: [PATCH] feat: cache tile.openstreetmap.org tiles for 7 days --- src/net/http.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/net/http.rs b/src/net/http.rs index 50b6e6964..68dff5fc7 100644 --- a/src/net/http.rs +++ b/src/net/http.rs @@ -108,6 +108,13 @@ fn http_url_cache_timestamps(url: &str, mimetype: Option<&str>) -> (i64, i64) { let stale = if url.ends_with(".xdc") { // WebXDCs are never stale, they just expire. expires + } else if url.starts_with("https://tile.openstreetmap.org/") + || url.starts_with("https://vector.openstreetmap.org/") + { + // Policy at + // requires that we cache tiles for at least 7 days. + // Do not revalidate earlier than that. + now + 3600 * 24 * 7 } else if mimetype.is_some_and(|s| s.starts_with("image/")) { // Cache images for 1 day. //