• Resolved Alex Kozack

    (@cawa-93)


    I set up a server for your instructions for delivering webp files. I did not use the plugin and resorted to setting it directly to nginx. But when requesting files jpg still returns exactly jpg (large size and Content-Type:image/jpeg)

Viewing 2 replies - 1 through 2 (of 2 total)
  • It is strongly recommended to use the Cache Enabler approach as it is easier to setup and works better overall. Just to double check, did you ensure you have the WebP option enabled in Optimus and that you re-optimized your image after enabling this option?

    • This reply was modified 7 years, 12 months ago by codyarsenault.
    Thread Starter Alex Kozack

    (@cawa-93)

    resolved by this code:

    
    set $webp "";
    if ($http_accept ~* image/webp) {
      set $webp ".webp";
    }
    
    location ~* ^(/wp-content/.+)\.(png|jpe?g)$ {
      expires 30d;
      root $root_path;
      default_type image/webp;
      add_header Vary Accept;
      try_files $1$webp $uri =404;
    }
    
    • This reply was modified 7 years, 12 months ago by Alex Kozack.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Configuration to deliver WebP’ is closed to new replies.