Merge 8e62c19fcac0df364721ecbd1649dd485f96debe into ecdc849232ac3a733709a5f55ec32352c2f244f1

This commit is contained in:
Kolsch Systems 2024-08-12 19:31:50 +00:00 committed by GitHub
commit 8e29abad88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -5,4 +5,10 @@ sendfile on;
tcp_nopush on;
# Don't wait to send data in keep-alive state.
tcp_nodelay on;
tcp_nodelay on;
# Check if web browser supports WebP images
map $http_accept $webp_suffix {
default "";
"~*webp" ".webp";
}

View File

@ -8,8 +8,14 @@ location ~* \.(?:rss|atom)$ {
expires 1h;
}
# Use the WebP version of converted PNG/JPEG images
location ~* ^.+\.(png|jpe?g)$ {
add_header Vary Accept;
try_files $uri$webp_suffix $uri =404;
}
# Caches images, icons, video, audio, HTC, etc.
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ {
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc|webp)$ {
expires 1y;
access_log off;
}