Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

webp images

$
0
0
Hello,

I have just moved från Apache to Nginx.

I cannot set an expiration date for webp images. I use Drupal. I have uploaded png images to Drupal. Drupal converts them to webp and the files get the extension "png.webp".

This is my code in the service section.

location ~* \.(js|css|png|jpg|jpeg|gif|ico|webp|svg)$ {
try_files $uri /index.php?$query_string;
expires 1y;
}

It works for all files execpt webp. Lighthouse complains that I do not have an effiecnt cache policy for webp files. I can also see in the browser that they don't get an expiration date.

I have followed a lot of tutorials but none of them work for me. Here are som examples.

https://www.wpfastestcache.com/tutorial/how-to-serve-webp-images-on-nginx/
https://themify.me/docs/enable-webp-on-nginx-litespeed-servers

Help would be appreciated.

Fred

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>