Skip to content

Commit 879d59e

Browse files
authored
fix: ordering
1 parent bad326f commit 879d59e

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

nginx.conf

+14-14
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ http {
4747
try_files $uri $uri.html $uri/index.html /$uri /$uri/index.html =404;
4848
}
4949

50+
# Media: images, icons, video, audio, HTC
51+
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webp|webm|htc|woff2|woff)$ {
52+
expires 1y;
53+
access_log off;
54+
}
55+
56+
# CSS and Javascript
57+
location ~* \.(?:css|js)$ {
58+
expires 1y;
59+
access_log off;
60+
}
61+
5062
# Plausible script
5163
location /js/script.js {
5264
# Change this if you use a different variant of the script
@@ -56,8 +68,8 @@ http {
5668
# Tiny, negligible performance improvement. Very optional.
5769
proxy_buffering on;
5870

59-
# disable cache
60-
expires off;
71+
# make cache WAY lighter
72+
expires 1d;
6173
}
6274

6375
# Plausible script
@@ -71,17 +83,5 @@ http {
7183
proxy_set_header X-Forwarded-Proto $scheme;
7284
proxy_set_header X-Forwarded-Host $host;
7385
}
74-
75-
# Media: images, icons, video, audio, HTC
76-
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webp|webm|htc|woff2|woff)$ {
77-
expires 1y;
78-
access_log off;
79-
}
80-
81-
# CSS and Javascript
82-
location ~* \.(?:css|js)$ {
83-
expires 1y;
84-
access_log off;
85-
}
8686
}
8787
}

0 commit comments

Comments
 (0)