|
24 | 24 | ##
|
25 | 25 | ## fastcgi_param MAGE_MODE $MAGE_MODE;
|
26 | 26 | ##
|
27 |
| -## In production mode, you should uncomment the 'expires' directive in the /static/ location block |
| 27 | +## In production mode, you should uncomment the 'add_header Cache-Control "public, max-age=31536000, immutable"' directive in the /static/ location block |
28 | 28 |
|
29 | 29 | # Modules can be loaded only at the very beginning of the Nginx config file, please move the line below to the main config file
|
30 | 30 | # load_module /etc/nginx/modules/ngx_http_image_filter_module.so;
|
@@ -105,17 +105,16 @@ location /pub/ {
|
105 | 105 |
|
106 | 106 | location /static/ {
|
107 | 107 | # Uncomment the following line in production mode
|
108 |
| - # expires max; |
| 108 | + # add_header Cache-Control "public, max-age=31536000, immutable"; |
109 | 109 |
|
110 | 110 | # Remove signature of the static files that is used to overcome the browser cache
|
111 | 111 | location ~ ^/static/version\d*/ {
|
112 | 112 | rewrite ^/static/version\d*/(.*)$ /static/$1 last;
|
113 | 113 | }
|
114 | 114 |
|
115 | 115 | location ~* \.(ico|jpg|jpeg|png|gif|svg|svgz|webp|avif|avifs|js|css|eot|ttf|otf|woff|woff2|html|json|webmanifest)$ {
|
116 |
| - add_header Cache-Control "public"; |
| 116 | + add_header Cache-Control "public, max-age=31536000, immutable"; |
117 | 117 | add_header X-Frame-Options "SAMEORIGIN";
|
118 |
| - expires +1y; |
119 | 118 |
|
120 | 119 | if (!-f $request_filename) {
|
121 | 120 | rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
|
@@ -167,9 +166,8 @@ location /media/ {
|
167 | 166 | }
|
168 | 167 |
|
169 | 168 | location ~* \.(ico|jpg|jpeg|png|gif|svg|svgz|webp|avif|avifs|js|css|eot|ttf|otf|woff|woff2)$ {
|
170 |
| - add_header Cache-Control "public"; |
| 169 | + add_header Cache-Control "public, max-age=31536000, immutable"; |
171 | 170 | add_header X-Frame-Options "SAMEORIGIN";
|
172 |
| - expires +1y; |
173 | 171 | try_files $uri $uri/ /get.php$is_args$args;
|
174 | 172 | }
|
175 | 173 | location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
|
|
0 commit comments