Image never updates cause it uses source from cache and not from link?

Lets say i have an with this src: http://myserver/images/profileimage.png
something like that i.e.:
<img src="http://myserver/images/profileimage.png" class="item-avatar-video">
well on the first startup it gets my profilepicture perfectly,

So for now lets say i change the picture on my server to another picture but with the same name.
Well now should be a other picture displayed in that img.
But no i still see the old picture which doesnt event exist anymore on my server.

And here is the thing:
If i go to the Application Settings on Android and Clear the Cache from my app my image get updated with the new one.

So how can i stop my img from getting the img source from my cache.
I want my images to get updated after i change them on the server??
How can i do that?

I think this is likely a configuration problem on the server end.

Add a random string like ?random=123876 behind the URI that gets changed every time the picture is shown. Not it will be loaded from the server every time.

I believe there are some proxies out there that won’t treat query strings as different resources for caching purposes. I think a more robust solution is to manage the Cache-Control and Expires headers as desired on the server.

1 Like

Yeah the serverside solution is better and keeps my cache healthy :smiley:

But i dont have the knowledge at the moment how i could set these headers?

Could you show me an example maybe?

It is completely dependent on what HTTP server you’re using. I use nginx, and the http_headers_module has an “expires” directive.

Using a Cordova Plugin witch disable Webview Cache of my App + Running the Code where i update the List in NgZone sloved my Problem :slight_smile: