If you want to prevent browser image caching in HTML? Expanding on the previous comments, add the image with a time stamp, like so:
1 2 3 4 5 6 7 8 | <div id="bck-img"></div> <script type="text/javascript"> var container = document.getElementById("bck-img"); var image = document.createElement("img"); image.setAttribute("src", _spPageContextInfo.webAbsoluteUrl+ "/SiteAssets/article-photo.jpg?rev="+new Date().getTime()); container.appendChild(image); </script> |
_spPageContextInfo.webAbsoluteUrl is the URL of the current sharepoint web, whereas ?rev=”+new Date().getTime(); appends the timestamp to the filename, ensuring it’ll be loaded from server on every page load.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.