Jump to content

Image caching problem


scott212

Recommended Posts

I've got a community site build in progress and it handles image uploads to be associated with an identity. When the script uploads the image it of course resizes, renames, and places the image in the users directory. Well now that I've added the ability to change that image, since the new image is in the same place as the old one and has the same name, the browser has a hard time letting go of the old one. Anyone got any ideas on how this should be handled?

For now I'm using an old flash cheat that sorta works where you append a random number to the end of the html image call such as:
[code]

<img src="blahblah.jpg?rand=<? echo rand(0,999); ?>" /> 

// result: <img src="blahblah.jpg?rand=567" />

[/code]
Link to comment
https://forums.phpfreaks.com/topic/33236-image-caching-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.