.webp with CDN
-
Hi,
we have converted all our images to webp using your service and uploaded them to the CDN.
So we have now 2 files for each images hosted at your CDN.
As an example:https://cdn1.hundemarmelade.de/wp-content/uploads/2022/04/Stevi-und-Schnuecks_Header_Start.jpg => .jpg image
https://cdn1.hundemarmelade.de/wp-content/uploads/2022/04/Stevi-und-Schnuecks_Header_Start.webp => .webp imageYour plugin does a rewrite by using a NGINX rewrite rule which delivers the webp image instead of the requested jpg file in case the browser of the visitor supports webp.
location ~* ^(?<path>.+)\.(jpe?g|png|gif)$ { if ( $http_accept !~* "webp|\*/\*" ) { break; } expires 31536000s; etag on; if_modified_since exact; add_header Pragma "public"; add_header Cache-Control "public"; add_header X-Powered-By "W3 Total Cache/2.2.1"; add_header Referrer-Policy "no-referrer-when-downgrade"; add_header Vary Accept; try_files ${path}.webp $uri =404;
}`
Since we are loading the images from our CDN the HTTP Requests are not hitting our webserver at all and thus the NGINX rewrite rule will not work.
If we switch of CDN feature everything works as it should.So how can i make that work together with the CDN usage of your tool? It must somehow be handled in the browser / markup or by javascript?
Thank you a lot for your awesome support.
Best
Frank
- The topic ‘.webp with CDN’ is closed to new replies.