Replacing image

On a page with images of members of a group, the PHP page allows a user to click on their image to replace it.  This brings up a form that uploads the new image and stores it.

The problem is the same image file name is used, so the user sees a cached copy of the old image instead of the new one.

I hate to set the whole page to expire immediately because there can be several dozen images and caching is really a big benefit.

Is there a way to get this one image to not use the cached copy?

I can always assign a new file name to the image, but that change will affect several programs, so I'm trying to avoid doing that.

Any tips/tricks appreciated!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

When the user uploads the file, you can change the filename : put a timestamp or an id. Then the file would not exits in the browser cache.
wilri01Author Commented:
Right, I said in my post I know about this solution, but it requires changing several programs.  Do you have any other options?

I think if you find a solution to force the browser to refresh their cache upon one request. Then you should find another solution to solve the problem for refresh the proxy cache (not so easy too)

Another way, It think we can find an easy way to change the image expiration, but download the image on each request, is not really good.

Well, to find a workaround seems difficult (for me).



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wilri01Author Commented:
Okay.  I'll just take the time to change the image file name.

Thanks for you input.
Guy Hengel [angelIII / a3]Billing EngineerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.