lucy24 - 10:39 pm on Nov 7, 2012 (gmt 0)
You'll need to set the image properties (both the real and the replacement) so that it is not cached
I found out by direct experiment that the only one that matters is the image that is actually displayed. It doesn't matter in the present case, because the image is only sometimes rewritten. But if the image is always rewritten, then only the "real" image's properties matter.
ExpiresByType image/gif "access"
Yes, the Files and the "ExpiresByType" are redundant. Belt and suspenders. I put it in its own little htaccess in the small, obscure directory that the image lives in. Belt and suspenders and, um, rivets. No caching at all is pretty strong stuff, so I wanted to be sure no browser wasted its own resources asking for something that hadn't changed.
RewriteRule ^images/image\.png$ /directory/images/new-image.png[L]
I assume that was a typo and there's really a space before the [L].
And I think everyone has been assuming that your rewrite audience has a fixed IP. Otherwise the rule will stop working the next time they restart their modem.