Cloudflare Polish - 不使用 /cdn-cgi/image/ URL 前缀提供 webp/avif 图像

发布于 2025-01-16 12:17:27 字数 355 浏览 2 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

格子衫的從容 2025-01-23 12:17:27

无需通过 /cdn-cgi/ 路由图像即可使用 Cloudflare Polish。
这会自动应用于图像,无需对 URL 进行任何更改。

如果您正在排查任何问题,

  1. 请清除相关图像 URL 的 cloudflare 缓存,
  2. 检查图像上的 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

  1. clear the cloudflare cache for the image URL(s) in question
  2. check the 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 the status=webp_bigger in the cf-polished header).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文