Skip to content

Commit ff8fd9e

Browse files
authored
cache the assets, but force html to reload (#1243)
1 parent 48a9eba commit ff8fd9e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

compose/nginx/nginx.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ http {
7979
server_name _;
8080
root /compose/neurosynth-frontend/dist;
8181

82+
location /assets/ {
83+
add_header Cache-Control "public, max-age=31536000, immutable" always;
84+
}
85+
8286
location /static/ {
87+
add_header Cache-Control "public, max-age=31536000, immutable" always;
8388
}
8489

8590
location /api {
@@ -93,6 +98,7 @@ http {
9398
}
9499

95100
location / {
101+
add_header Cache-Control "no-store, must-revalidate" always;
96102
try_files $uri /index.html;
97103
}
98104

compose/nginx/nginx.dev.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ http {
8080
server_name _;
8181
root /compose/neurosynth-frontend/build;
8282

83+
location /assets/ {
84+
add_header Cache-Control "public, max-age=31536000, immutable" always;
85+
}
86+
8387
location /static/ {
88+
add_header Cache-Control "public, max-age=31536000, immutable" always;
8489
}
8590

8691
location /api {
@@ -94,6 +99,7 @@ http {
9499
}
95100

96101
location / {
102+
add_header Cache-Control "no-store, must-revalidate" always;
97103
try_files $uri /index.html;
98104
}
99105

0 commit comments

Comments
 (0)