I use WP Fastest Cache plugin which produces webp version of jpg, png etc and serve them as long as user’s browser supports. However, when I use free plan of Cloudflare, webp images are not in service although the browser supports webp. I bought premium plan of Cloudflare for another website which has the same situation, and now it serves webp images. Why free plan of Cloudflare has such problem?
By default the Cloudflare cache does not include information about the browsers Accept request header. This is the header used by the Origin to decide whether to deliver a jpeg or WebP image.
There are two common solutions, which require Pro Plan or above:
Use Cloudflare Polish to perform the image optimisation, and disable the WebP conversion on the Origin.
Use Vary for Images, which essentially adjusts the cache key to include the requested image format.
There are several other solutions which are also available on Free plans, including Transform Rules and Workers. Searching on the community will turn up several discussions on the same topic.