I've noticed a strange behaviour in my angular 5 app in various places where I display images in the following way
<img src="{{user.avatar}}"/>
Chrome will show a picture of another user although when I console.log or debug the app the url printed is the correct one. When I change browser tab and return to the current tab, the correct image will load, which leads me to the assumption that this is a browser caching issue.
The behaviour is random and seems not to be happening in Firefox. I've also tried <img [src]="user.avatar"/>
with the same results.
Also tried to add random dummy parameter on the src value to prevent the browser caching: <img src="{{contact.userData.avatar+'?id='+randomId()}}"/>
This seems to work but makes image loading pretty slow so I prefer to avoid it. Any ideas why this is happening?