I am currently working on a Cordova App and I am using
<img class="profile-thumbnail" src="cdvfile://localhost/persistent/Photo/mypicture.jpg">
to display content in the view.
However, when I generate a new mypicture.jpg
file using the file API to overwrite the existing one, the picture disappears from the view and does not come back until I kill and relaunch the app.
I have tried updating the image source with
$('.profile-thumbnail').attr('src','cdvfile://localhost/persistent/Photo/mypicture.jpg');
after a successful storage call, but the correct picture is still not displayed immediately after the update.
The new file is only displayed properly after relaunching the app. How does the cdvfile:// protocol handle updates? Is there a cache that needs to be flushed after updating the file?
Are there any recommended techniques for handling this type of request?