From: Tom Hughes Date: Fri, 22 Nov 2019 17:06:59 +0000 (+0000) Subject: Tell browsers they can use stale tiles X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/5b6c232cefcc8d75ba5dae17db4bfb2e70a09385 Tell browsers they can use stale tiles --- diff --git a/cookbooks/tile/templates/default/apache.erb b/cookbooks/tile/templates/default/apache.erb index 8df11453b..e5d7f1719 100644 --- a/cookbooks/tile/templates/default/apache.erb +++ b/cookbooks/tile/templates/default/apache.erb @@ -40,6 +40,9 @@ # Add diagnostics header to identify render server Header set X-TileRender "<%= node.name %>" + # Tell clients to use stale tiles if necessary + Header append Cache-Control "stale-while-revalidate=604800, stale-if-error=604800" "expr=%{CONTENT_TYPE} == 'image/png'" + # Remove Proxy request header to mitigate https://httpoxy.org/ RequestHeader unset Proxy early