Use the WebP version of converted PNG/JPEG images

This commit is contained in:
Kolsch Systems 2021-08-16 14:13:37 -07:00
parent 154784387a
commit 8e62c19fca
No known key found for this signature in database
GPG Key ID: 028833B3033A172E

View File

@ -8,6 +8,12 @@ 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|webp)$ {
expires 1y;