Skip to content

Commit

Permalink
frontend: Add 30-day caching for some static assets (js/css/...)
Browse files Browse the repository at this point in the history
To improve loading time. The angular js files are served with a hash value
in the filename, which enables long caching without the problem when updating
the scripts.
  • Loading branch information
dev-jan committed May 24, 2021
1 parent 65ee3db commit 4853a6d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ server {
location / {
try_files $uri $uri/ /index.html;
}
location ~* \.(js|css|png|jpg|jpeg|gif|svg|ico)$ {
expires 30d;
add_header Cache-Control "public, no-transform";
}
location /api/ {
proxy_pass ${API_BACKEND_URL};
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down

0 comments on commit 4853a6d

Please sign in to comment.