i have an image in my page, the image is cached in the browser.
now i have deleted the image, however Because it was cached, the request does not go to the server, And it appears again.
so How can I delete it from the browser cache?
No you cannot physically delete cached file. Instead you can generate link to the file dynamically, for example
<script type="text/javascript">
document.write('<img id="without-cache" src="image.jpg?v=' + new Date().getTime() + '" />');
</script>
and eventually change the source with different ?v= when you want to reload it without loading it from cache.
$("#without-cache").attr("src", "image.jpg?v=" + new Date().getTime());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With