Shifter standards WebP under MediaCDN enabled environment

What is WebP

"WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster.

WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller than comparable JPEG images at equivalent SSIM quality index."

via A new image format for the Web

Advantage

Shifter delivers contents from visitors nearest CDN's edge location. With this feature enabled, jpeg, gif and png files are provided as webP format, so that your websites will be lightweight without any additional coding or plugins.
 

How to enable WebP for Shifter websites

Only enable MediaCDN feature on your Shifter site if you're Tier2 or greater plan user.
Please follow the steps on the support document Shifter Media CDN for enabling it.

Once MediaCDN is activated, Shifter transfers all media in your WordPress Media Library to the CDN and converts JPG, GIF and PNG files to WebP without changing filename including their extensions. You can export original files anytime.
When Shifter receives requests from supported browsers, Shifter delivers WebP media.

WebP supported web browsers

Desktop

  • Firefox version 65+
  • Google Chrome version 32+
  • Microsoft Edge version 80+
  • Opera version 19+

Mobile

  • Google Chrome for Android version 25+
  • Native web browser, Android 4.2+ (JB-MR1)

Safari still doesn't support this file format, so access supported browser to confirm how WebP works.
For more supported browser details, please access Which web browsers natively support WebP? and Can I use WebP image format.

 

How to check files are converted

Check header requests with accessing supported browser or use cURL command with -H 'Accept: image/webp' option.

MediaCDN and WebP are disabled

Shifter returns image/jpeg.
Content-length is 26897 bytes which is the size of the file.

% curl -I https://clever-hertz8618.on.getshifter.io/wp-content/uploads/2013/03/soworthloving-wallpaper.jpg -H 'Accept: image/webp'
HTTP/2 200
content-type: image/jpeg
content-length: 26897
date: Tue, 17 Mar 2020 04:36:31 GMT
last-modified: Tue, 17 Mar 2020 04:34:53 GMT
etag: "6efb832a0033f2199f26eb52ed14b310"
server: AmazonS3
x-cache: Miss from cloudfront
via: 1.1 2e231341de86384b8185d321eaa7acd3.cloudfront.net (CloudFront)
x-amz-cf-pop: NRT20-C2
x-amz-cf-id: n0NFaYithmfLAuhv6CNv-cWznOOw5FLEmAaFM1igi0iqYLd36RBMkg==

 

MediaCDN and WebP are enabled

Access with -H 'Accept: image/webp' option.
Shifter returns image/webp  for content-type.
Content-length is 12548 bytes, it's almost 50% smaller than same jpeg file.

% curl -I https://cdndev.getshifter.co/93503e0d641b7f5c447f04f624f3146f43bd02e0/uploads/2013/03/soworthloving-wallpaper.jpg -H 'Accept: image/webp'
HTTP/2 200
content-type: image/webp
content-length: 12548
date: Tue, 17 Mar 2020 04:21:35 GMT
last-modified: Tue, 17 Mar 2020 03:36:12 GMT
etag: "c555359498717d5822c2dc4179e3624e"
cache-control: max-age=31104000
x-amz-version-id: ecyi3o5z2Y0PZNBNpvlzL4WNqPno.qKc
accept-ranges: bytes
server: AmazonS3
x-cache: Hit from cloudfront
via: 1.1 0bc155b40d887df7641ec94214c25e5d.cloudfront.net (CloudFront)
x-amz-cf-pop: NRT20-C4
x-amz-cf-id: jPJssfofnVm1vPjLY9Djfl0ggZlVjUPUZmt48sQK4FALRUGpTxB1qg==
age: 21

 

Q and A

Q. Are original files deleted after uploading or converting?

A. No. Shifter doesn't delete original files. Shifter MediaCDN only converts them to WebP and delivers to browser.

 

Q. What happen if WebP unsupported browsers accessed to the files?

A. MediaCDN returns original files (jpeg, gif or png).

Did this answer your question?