Skip to content

Commit 88abcd6

Browse files
committed
Changed expiration (CSS & JS) and set Cache-Control public for HTML
1 parent 96f31f4 commit 88abcd6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

rocket-nginx.conf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Tested with WP-Rocket version: 2.3.10
1111
# Tested with NGINX: 1.6.2 (stable)
1212
#
13-
# Version 0.2.1
13+
# Version 0.3
1414
#
1515
###################################################################################################
1616

@@ -87,6 +87,7 @@ if ($rocket_debug = 0) {
8787

8888
# Add header to HTML cached files
8989
location ~ /wp-content/cache/wp-rocket/.*html$ {
90+
add_header Cache-Control public;
9091
add_header Vary "Accept-Encoding, Cookie";
9192
add_header X-Rocket-Nginx-Bypass $rocket_is_bypassed;
9293
add_header X-Rocket-Nginx-Reason $rocket_reason;
@@ -97,6 +98,7 @@ location ~ /wp-content/cache/wp-rocket/.*_gzip$ {
9798
gzip off;
9899
types {}
99100
default_type text/html;
101+
add_header Cache-Control public;
100102
add_header Content-Encoding gzip;
101103
add_header Vary "Accept-Encoding, Cookie";
102104
add_header X-Rocket-Nginx-Bypass $rocket_is_bypassed;
@@ -109,7 +111,7 @@ location ~ /wp-content/cache/wp-rocket/.*_gzip$ {
109111
#
110112
location ~ /wp-content/cache/min/.*\.css$ {
111113
gzip_vary on;
112-
expires 30d;
114+
expires max;
113115
}
114116

115117

@@ -118,7 +120,7 @@ location ~ /wp-content/cache/min/.*\.css$ {
118120
#
119121
location ~ /wp-content/cache/min/.*\.js$ {
120122
gzip_vary on;
121-
expires 30d;
123+
expires max;
122124
}
123125

124126

0 commit comments

Comments
 (0)