Добавил оптимизацию загрузки картинок
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user