]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/apache.erb
Tell browsers they can use stale tiles
[chef.git] / cookbooks / tile / templates / default / apache.erb
index 8df11453b66850799e2ce63c65145801e709e894..e5d7f17192bbca6ebb7b2987e40da32a038a254e 100644 (file)
@@ -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