Skip to content

Commit

Permalink
Add caching policy to sitemap search
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Nov 28, 2024
1 parent 59d7bb2 commit 23a00f6
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ http {
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 20d;
proxy_buffering off;

location ~* \.(?:jpg|jpeg|gif|png|webp|ico)$ {
expires 1M;
access_log off;
add_header Cache-Control "max-age=2629746, public";
proxy_pass http://sitemap_search:8080;
}

location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "max-age=31556952, public";
proxy_pass http://sitemap_search:8080;
}
}

location /search {
Expand Down Expand Up @@ -255,6 +269,20 @@ http {
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 20d;
proxy_buffering off;

location ~* \.(?:jpg|jpeg|gif|png|webp|ico)$ {
expires 1M;
access_log off;
add_header Cache-Control "max-age=2629746, public";
proxy_pass http://sitemap_search:8080;
}

location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "max-age=31556952, public";
proxy_pass http://sitemap_search:8080;
}
}

location /search {
Expand Down

0 comments on commit 23a00f6

Please sign in to comment.