I'm displaying images with a ng-repeat directive in a angularjs app served from a local MAMP installation:
<tr ng-repeat="Visuel in Visuels">
<td>
<img alt="visuel" ng-src="{{ROOT_URL}}{{Visuel.Repertoire}}{{Visuel.Fichier}}_t{{Visuel.Extension}}">
</td>
</tr>
Those images sometimes do not reflect changes made to the file they point to
users submit those images which I upload as a string using $http.post(). This process works as I can see the resulting image browsing server files directly from Finder
On file upload I replace the Visuels model (on which the ng-repeat operates) with the new data from server. The img src will not change, as the file is saved with the same name. I want the old image to be replaced by the new one.
So, the file on the server does change, and that is not reflected on screen, unless I reload the page, which makes me thinks it's related to caching.
However I'm not sure if the culprit is Firefox or MAMP. I've disable caching in my php.ini as instructed in this answer:
[OPcache]
;zend_extension="/Applications/MAMP/bin/php/php5.6.2/lib/php/extensions/no-debug-non-zts-20131226/opcache.so"
; opcache.memory_consumption=128
; opcache.interned_strings_buffer=8
; opcache.max_accelerated_files=4000
; opcache.revalidate_freq=60
; opcache.fast_shutdown=1
; opcache.enable_cli=1
How to pinpoint which caching part is preventing the image from displaying on screen?
If this makes no sense, is there something special I should do programmatically in javascript to tell images to verify their src?
If this makes even less sense, am I missing a very important basic concept about life here?
Aucun commentaire:
Enregistrer un commentaire