I have a asp image control. ImageUrl="images/avator.jpg". I'm changing this picture on the server and then setting imageUrl same as previous url on the client. but image don't changed. When i click refresh button, image changed. How to change cached image won't changing url?
+4
A:
You can add random number as a paramentr to avoid caching.
<img src="http://someurl.com/avatar.png?version=0.01.135";
The best way is to add number of application build version. So every time you change something in aplpication everything will load again.
Eldar Djafarov
2009-09-01 10:01:20
Better use current date-time as a parameter in the URL
Faiz
2009-09-01 10:23:12
date-time will prevent caching at all. I do not think it is a good idea.
Eldar Djafarov
2009-09-01 10:25:54
Using version number is best, so you will cause re-load when needed. Using date-time will load every time, even when not needed. It is a reason images are cached; they can take long time to load!
awe
2009-09-01 10:53:58