Cloudflare Polish - 不使用 /cdn-cgi/image/ URL 前缀提供 webp/avif 图像
在 Cloudflare Polish 文档下,提到了使用 format=auto< /代码> 选项。有没有办法在不使用图像 URL 中的
/cdn-cgi/image/
路径前缀的情况下使用此选项?
如果我确实使用该路径,那么我会看到使用 content-type: image/webp
响应标头提供的图像。如果没有特殊的 URL,我看不到内容类型有任何变化(它只是作为 jpeg 提供)。
文档
Under the documentation for Cloudflare Polish it is mentioned about using the format=auto
option. Is there a way to use this option without using the /cdn-cgi/image/
path prefix in my image URLs?
If I do use that path then I see the images served with the content-type: image/webp
response header. Without the special URL, I don't see any change to the content-typem (it's just served as jpeg).
The documentation
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无需通过 /cdn-cgi/ 路由图像即可使用 Cloudflare Polish。
这会自动应用于图像,无需对 URL 进行任何更改。
如果您正在排查任何问题,
cf-polish
响应标头,因为这会告诉您是否已进行优化,或者是否已进行优化。图像已经优化,因此 webp 不会带来任何好处(在这种情况下,您会在 cf-polish 标头中看到status=webp_bigger
)。It is not necessary to route images via /cdn-cgi/ to make use of Cloudflare Polish.
This is applied automatically to images with no change needed to be applied on the URLs.
If you are troubleshooting any issues with this
cf-polished
response header on the image as this will tell you if optimisation has taken place or if the image was already optimised and thus webp does not give any benefits (in which case you would see thestatus=webp_bigger
in the cf-polished header).