[thelist] Appending a querystring to an image file name: is it safe?

Erik Mattheis gozz at gozz.com
Thu Feb 20 13:00:01 CST 2003


On Thursday, February 20, 2003, at 12:41  PM, Koutoulas, Pete wrote:
> I have an image on a page that changes occasionally, but for numerous
> reasons, I need to keep the image name constant. The problem that
> develops
> from this is many people's browsers never request an update for the
> image
[...]
> Today I tried doing the same for the image in question, i.e., <img
> src="/images/myimage.gif?nc=12345" etc...> This seems to work fine in
> the
> few browsers I have around here. My question to you all is this: is
> this
> kludge safe in all browsers or will it break in some?

Not a kludge, rather a technique. Use it with confidence! Someone else
may be able to point you to an RFC or whatever.

>  Anyone know of a
> better way short of renaming the image with each change?

You might want to check your server's settings to make sure they're as
you want them.

Although you don't need the "nc=" ... image.gif?12345 will work the
same.

Once you implement the fix, you might notice that some of the visitors
still get the "old" image because the browser doesn't  even check for a
new page... in which case, you can try some JS to force a reload of
page.html?12345 and piss some people off for making their computer dial
up the Internet when they're off-line.
-----------------------
Erik Mattheis
GoZz Digital
<http://goZz.com/>
Flash and ColdFusion Development
Minneapolis, MN
-----------------------




More information about the thelist mailing list