I have a problem where users are reporting that their images aren't being uploaded and the old ones are still there. On closer inspection the new images are there, they just have the same name as the old one. What I do on the upload is that I rename the images for SEO purposes. When they delete an image the old index becomes available and is reused. Therefore it has the same image name.
Is there a way to (i thought maybe there might be a meta tag for this) to tell the browser to not use its cahce?
The better answer is to rename the image to something totally new. I will get working on that but in the mean time is the quick solution while I work on the bigger problem.
Yes the browser will cache them, often even when your headers say otherwise.
A hard refresh is a way of clearing the browser's cache for a specific page, to force it to load the most recent version of a page.
To hard refresh on Google Chrome on Mac Hold ⇧ Shift and click the Reload button. Or, hold down ⌘ Cmd and ⇧ Shift key and then press R.
Append a query string with an arbitrary unique number (or time, or version number, etc.):
<img src="image.png?80172489074" alt="a cool image" />
This will result in a new request, because of the different URL.
It's tough. You really want images to be cached, but then you don't want to cache them once a new ones available:
The solution? I can think of two good options:
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