Skip to content

Commit

Permalink
Merge pull request #1918 from chirino/optimize-fontend-cache-settings
Browse files Browse the repository at this point in the history
frontend: optimize the cache settings so that the assets are aggressively cached.
  • Loading branch information
mergify[bot] authored Feb 16, 2024
2 parents 7c98b91 + 8478f0c commit 63e47a2
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions ui/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
server {
listen 3000;
listen 3000;

location / {
root /usr/share/nginx/html/;
include /etc/nginx/mime.types;
try_files $uri $uri/ /index.html;
}
# all assets contain hash in filename, cache forever
location /assets/ {
root /usr/share/nginx/html/;
include /etc/nginx/mime.types;
try_files $uri $uri/ /index.html;
add_header Cache-Control "public, immutable, max-age=31536000, s-maxage=31536000";
}

location / {
root /usr/share/nginx/html/;
include /etc/nginx/mime.types;
try_files $uri $uri/ /index.html;
add_header Cache-Control "public";
}
}

0 comments on commit 63e47a2

Please sign in to comment.