1
I have an image that loads multiple times, each time with content that won’t be reused. to this problem, I found several answers suggesting something
var d = new Date();
buff.src="carrega.php?ver="+d.getTime();
Or with random number.
others suggest:
<meta Http-Equiv="Cache-Control" Content="no-cache">
<meta Http-Equiv="Pragma" Content="no-cache">
<meta Http-Equiv="Expires" Content="0">
<meta Http-Equiv="Pragma-directive: no-cache">
<meta Http-Equiv="Cache-directive: no-cache">
Good, the second solution simply doesn’t work. And if it did it would be for the whole page and I want to disable the cache of an image only.
The first is not a solution. It returns me different images, so far ok. But, every time I upload, the image is cached, which is what I want to avoid to not load memory usage (there are many images loaded during very long usage). I also don’t want to have to recommend the user to limit the cache storage space. That wouldn’t be troubleshooting, either.
Only disable cache by HTTP headers
– Costamilam
I tried this by disabling caching by the http headers of the image with: header("Pragma-Directive: no-cache"); header("Cache-Directive: no-cache"); header("Cache-control: no-cache"); header("Pragma: no-cache"); header("Expires: 0"); , and it doesn’t work. Keeps storing whenever the image is updated
– CMOT