Добавил оптимизацию загрузки картинок

This commit is contained in:
adlevin
2026-02-06 06:31:28 +03:00
parent 21361390d2
commit 56e4c1239b
7 changed files with 47 additions and 7 deletions

View File

@@ -21,7 +21,23 @@ server {
add_header Cache-Control "public, immutable";
}
# Image optimization
location ~* \.(jpg|jpeg|png|gif|svg|webp)$ {
expires 1y;
add_header Cache-Control "public, immutable";
add_header Vary "Accept-Encoding";
}
# WebP support with proper Content-Type
location ~* \.webp$ {
add_header Content-Type "image/webp";
expires 1y;
add_header Cache-Control "public, immutable";
}
# Gzip compression
gzip on;
gzip_types text/css application/javascript image/svg+xml;
gzip_types text/css application/javascript image/svg+xml application/json text/plain;
gzip_min_length 1000;
gzip_vary on;
}