Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Salvatore Fresta

    (@salvatorefresta)

    Hi @alriksson ,
    uhm.. I don’t think it can be possible, but not because I don’t want to, but for a matter of logic. Let me explain you.

    When your web page is into Cloudflare cache, your origin server is not “consulted”. So if you need to return any time a different HTML depending on client that requests the page (if it supports or not webp), I don’t think you can use Cloudflare as page cache.

    Thread Starter Rookie

    (@alriksson)

    Hi,

    Sure but the issue is not the html cache in the edge it’s the delivery of static images. The extension never change only the type (JPEG or WEBP).

    But sure this could be done with the worker. But here is what you by default will be facing with webp delivery webp based on browser support and only chanign type not extension on the origin if using Cloudflare.

    https://www.ads-software.com/plugins/webp-express/#i%20am%20on%20cloudflare

    Without configuration, Cloudflare will not maintain separate caches for jpegs and webp; all browsers will get jpeg. To make Cloudflare cache not only by URL, but also by header, you need to use the Custom Cache Key page rule, and add Header content to make separate caches depending on the Accept request header.

    However, the Custom Cache Key rule currently requires an Enterprise account. And if you already have that, you may as well go with the Polish feature, which starts at the “Pro” level plan. With the Polish feature, you will not need WebP Express.

    To make WebP Express work on a free Cloudflare account, you have the following choices:

    You can configure the CDN not to cache jpeg images by adding the following page rule: If rule matches: example.com/*.jpg, set: Cache level to: Bypass

    You can set up another CDN (on another provider), which you just use for handling the images. You need to configure that CDN to forward the Accept header. You also need to install a WordPress plugin that points images to that CDN.

    You can switch operation mode to “CDN friendly” and use HTML altering.

    Plugin Contributor Salvatore Fresta

    (@salvatorefresta)

    Hi @alriksson ,
    this is the behavior for all Cloudflare users, not for the only ones use this plugin. Do you want and option that add an extra page rule as described above? I can but the goal of this plugin is decrease the TTFB of the dynamic HTML page.

    I don’t know if I will add complexity to manage static assets (that’s should be done from the plugin that generates the webp version of the image)

    Thread Starter Rookie

    (@alriksson)

    Valid point, just a thought I had. Not sure if you even can set this with a page rule? Maybe with the workers thats why.

    Page rule only possible to alter this with enterprise plan. But should be doable in the workers.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add cloudflare support for webp’ is closed to new replies.