diff --git a/nginx.conf.sample b/nginx.conf.sample index 9ec16acee7250..1c406ff181ae9 100644 --- a/nginx.conf.sample +++ b/nginx.conf.sample @@ -112,7 +112,7 @@ location /static/ { rewrite ^/static/version\d*/(.*)$ /static/$1 last; } - location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|html|json)$ { + location ~* \.(ico|jpg|jpeg|png|gif|svg|svgz|webp|avif|avifs|js|css|eot|ttf|otf|woff|woff2|html|json|webmanifest)$ { add_header Cache-Control "public"; add_header X-Frame-Options "SAMEORIGIN"; expires +1y; @@ -166,7 +166,7 @@ location /media/ { deny all; } - location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ { + location ~* \.(ico|jpg|jpeg|png|gif|svg|svgz|webp|avif|avifs|js|css|eot|ttf|otf|woff|woff2)$ { add_header Cache-Control "public"; add_header X-Frame-Options "SAMEORIGIN"; expires +1y; diff --git a/pub/media/.htaccess b/pub/media/.htaccess index d68d163d7a6b5..42908cc63421e 100644 --- a/pub/media/.htaccess +++ b/pub/media/.htaccess @@ -52,9 +52,12 @@ AddType image/gif gif AddType image/png png AddType image/jpeg jpg AddType image/jpeg jpeg +AddType image/webp webp +AddType image/avif avif +AddType image/avif-sequence avifs # SVG -AddType image/svg+xml svg +AddType image/svg+xml svg svgz # Fonts AddType application/vnd.ms-fontobject eot @@ -63,9 +66,6 @@ AddType application/x-font-otf otf AddType application/x-font-woff woff AddType application/font-woff2 woff2 -# Flash -AddType application/x-shockwave-flash swf - # Archives and exports AddType application/zip gzip AddType application/x-gzip gz gzip @@ -75,7 +75,7 @@ AddType application/xml xml - + Header append Cache-Control public @@ -111,8 +111,8 @@ AddType application/xml xml ExpiresByType text/css "access plus 1 year" ExpiresByType application/javascript "access plus 1 year" - # Favicon, images, flash - + # Favicon, images + ExpiresDefault "access plus 1 year" ExpiresByType image/gif "access plus 1 year" @@ -120,6 +120,9 @@ AddType application/xml xml ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" + ExpiresByType image/webp "access plus 1 year" + ExpiresByType image/avif "access plus 1 year" + ExpiresByType image/avif-sequence "access plus 1 year" # Fonts diff --git a/pub/static/.htaccess b/pub/static/.htaccess index 84741c4ebb35e..eeda4c2e0e441 100644 --- a/pub/static/.htaccess +++ b/pub/static/.htaccess @@ -37,7 +37,6 @@ AddType application/javascript js jsonp AddType application/json json # HTML - AddType text/html html # CSS @@ -49,9 +48,12 @@ AddType image/gif gif AddType image/png png AddType image/jpeg jpg AddType image/jpeg jpeg +AddType image/webp webp +AddType image/avif avif +AddType image/avif-sequence avifs # SVG -AddType image/svg+xml svg +AddType image/svg+xml svg svgz # Fonts AddType application/vnd.ms-fontobject eot @@ -60,8 +62,8 @@ AddType application/x-font-otf otf AddType application/x-font-woff woff AddType application/font-woff2 woff2 -# Flash -AddType application/x-shockwave-flash swf +# Manifest +AddType application/manifest+json webmanifest # Archives and exports AddType application/zip gzip @@ -72,7 +74,7 @@ AddType application/xml xml - + Header append Cache-Control public @@ -100,6 +102,12 @@ AddType application/xml xml ExpiresByType application/zip "access plus 0 seconds" ExpiresByType application/x-gzip "access plus 0 seconds" ExpiresByType application/x-bzip2 "access plus 0 seconds" + + # Manifest + + ExpiresDefault "access plus 0 seconds" + + ExpiresByType application/manifest+json "access plus 0 seconds" # CSS, JavaScript, html @@ -111,7 +119,7 @@ AddType application/xml xml ExpiresByType application/json "access plus 1 year" # Favicon, images, flash - + ExpiresDefault "access plus 1 year" ExpiresByType image/gif "access plus 1 year" @@ -119,6 +127,9 @@ AddType application/xml xml ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" + ExpiresByType image/webp "access plus 1 year" + ExpiresByType image/avif "access plus 1 year" + ExpiresByType image/avif-sequence "access plus 1 year" # Fonts @@ -129,5 +140,7 @@ AddType application/xml xml ExpiresByType application/x-font-otf "access plus 1 year" ExpiresByType application/x-font-woff "access plus 1 year" ExpiresByType application/font-woff2 "access plus 1 year" + ExpiresByType font/opentype "access plus 1 year" + ExpiresByType font/truetype "access plus 1 year"