From 8ed64eefeecb52540103054896bbff57370d1151 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Thu, 30 Jan 2025 15:45:11 +0000 Subject: [PATCH] imagery: different cache key per image format --- .../default/nginx_imagery_layer_fragment.conf.erb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cookbooks/imagery/templates/default/nginx_imagery_layer_fragment.conf.erb b/cookbooks/imagery/templates/default/nginx_imagery_layer_fragment.conf.erb index 8cdd2acdd..723d0d0f2 100644 --- a/cookbooks/imagery/templates/default/nginx_imagery_layer_fragment.conf.erb +++ b/cookbooks/imagery/templates/default/nginx_imagery_layer_fragment.conf.erb @@ -3,10 +3,7 @@ location ~* "^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.(jpg|jpeg|png|webp)$" { <% if @uses_tiler -%> set $args ""; - rewrite ^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.jpg /mosaicjson/tiles/WebMercatorQuad/$1/$2/$3@1x?url=<%= URI.encode_www_form_component(@source) %>&pixel_selection=first&tile_format=jpeg break; - rewrite ^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.jpeg /mosaicjson/tiles/WebMercatorQuad/$1/$2/$3@1x?url=<%= URI.encode_www_form_component(@source) %>&pixel_selection=first&tile_format=jpeg break; - rewrite ^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.png /mosaicjson/tiles/WebMercatorQuad/$1/$2/$3@1x?url=<%= URI.encode_www_form_component(@source) %>&pixel_selection=first&tile_format=png break; - rewrite ^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.webp /mosaicjson/tiles/WebMercatorQuad/$1/$2/$3@1x?url=<%= URI.encode_www_form_component(@source) %>&pixel_selection=first&tile_format=webp break; + rewrite ^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.(jpg|jpeg|png|webp) /mosaicjson/tiles/WebMercatorQuad/$1/$2/$3@1x?url=<%= URI.encode_www_form_component(@source) %>&pixel_selection=first&tile_format=$4 break; proxy_pass http://<%= @site %>_tiler_backend; proxy_set_header Host $host; proxy_set_header Referer $http_referer; @@ -18,7 +15,7 @@ location ~* "^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.(jpg|jpeg|png|webp)$" { proxy_set_header Cache-Control ""; proxy_set_header Pragma ""; proxy_redirect off; - proxy_cache_key "<%= @layer %><%= @revision %> $request_method $1 $2 $3"; + proxy_cache_key "<%= @layer %><%= @revision %> $request_method $1 $2 $3 $4"; proxy_cache proxy_cache_zone; proxy_cache_valid 200 204 180d; proxy_cache_use_stale error timeout updating http_502 http_503 http_504; -- 2.39.5