Update picture and not show the one in the browser cache?

Hi,

I'm able to upload a pic and updated it later.
My problem now is that after uploading the old picture is shown, it is
taken from the browser cache I guess.

In my app I only cache js and css.

I've tried:

expire_page "/tabs/#{@tab.id}"
redirect_to(@tab)

But it doesn't go away until I press F5 in the browser. Then the update
picture is shown.

Any hints?

Hi,

In case anyone is interested I've solved my problem by adding a
timestamp to the picture name. That way the picture changes name when
updated so cache is not affecting at all.

Cheers.

Did you add the timestamp as a GET variable, or as part of the actual filename? How did you do it?

Rails adds the timestamp as a GET variable for CSS and JS files (“style.css?185673820” instead of “style_185673820.css”).