mod_rewrite 到另一个域上的图像会消耗原始域的带宽吗?

发布于 2024-08-31 12:17:14 字数 685 浏览 3 评论 0原文

我想使用 mod_rewrite 在图像文件名中包含日期,这样浏览器就会知道在图像发生更改时刷新图像,尽管有任何过期标头。

我的重写规则是

RewriteRule ^images/[0-9]+/(.*)$ http://my-amazon-bucket.s3.amazonaws.com/$1

应该变成类似

http://example.com/images/2010-08-11/example-image.jpg

进入

<代码>http://my-amazon-bucket.s3.amazonaws。 com/example-image.jpg

第一个域会承载整个图像文件的带宽吗?

I want to use mod_rewrite to include a date in an image filename, so browsers will know to refresh an image anytime it's changed, despite any expires headers.

My rewrite rule is

RewriteRule ^images/[0-9]+/(.*)$ http://my-amazon-bucket.s3.amazonaws.com/$1

which should turn something like

http://example.com/images/2010-08-11/example-image.jpg

into

http://my-amazon-bucket.s3.amazonaws.com/example-image.jpg

Will the first domain be carrying the bandwidth of the entire image file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

奈何桥上唱咆哮 2024-09-07 12:17:14

您的规则将产生一个响应,告诉客户端发送另一个到目标位置以从那里检索资源(请参阅 HTTP 响应状态代码 302)。

仅当您使用代理时(使用 P< /em> 标志,另请参阅 mod_proxy)服务器将从远程请求资源并将其传递给客户端,从而导致输入和输出加倍。

Your rule will result in a response that tells the client to send another to the target location to retrieve the resource from there (see HTTP response status code 302).

Only if you’re using a proxy (using the P flag, see also mod_proxy) your server would request the resource from remote and pass it to the client, resulting in doubling the in- and output.

盛夏已如深秋| 2024-09-07 12:17:14

第一个客户端收到请求,然后将其传递给第二个客户端。因此提供图像的带宽将由第二台主机处理。

the first client gets the request, but then passes it onto the second. So the bandwidth to provide the image would be handled by the second host.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文