views:

50

answers:

2

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?

+1  A: 

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.

Gumbo
A: 

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.

David Larrabee