Skip to content

Commit

Permalink
Simplify caching setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed Jan 23, 2025
1 parent 081a7f1 commit 723a9a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ http {
}

# never cache the importmap, routes, or service-worker
location ~* (((importmap|routes\.registry)\.json)|service-worker\.js)$ {
location /service-worker.js {
expires -1d;
try_files $uri =404;
}

# handle anything with a "." that's not an HTML
# assume it's a static file
location ~* \.(?!html?)[^.]+$ {
expires 6M;
add_header 'Cache-Control' 'no-cache, must-revalidate'
try_files $uri =404;
}

Expand Down

1 comment on commit 723a9a5

@enyachoke
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ibacher this breaks the frontend with this error

nginx: [emerg] invalid number of arguments in "add_header" directive in /etc/nginx/nginx.conf:38
2025/01/24 07:26:21 [emerg] 1#1: invalid number of arguments in "add_header" directive in /etc/nginx/nginx.conf:38
nginx: [emerg] invalid number of arguments in "add_header" directive in /etc/nginx/nginx.conf:38
2025/01/24 07:27:21 [emerg] 1#1: invalid number of arguments in "add_header" directive in /etc/nginx/nginx.conf:38
nginx: [emerg] invalid number of arguments in "add_header" directive in /etc/nginx/nginx.conf:38

Please sign in to comment.